()
This task renews the x509 Service Provider certificates one week before
    they expire (so that there is ample time to respond if there is a problem).
This task renews the x509 Service Provider certificates one week before
    they expire (so that there is ample time to respond if there is a problem).
This task renews the x509 Service Provider certificates one week before they expire ( so that there is ample time to respond if there is a problem ) .
def renew_service_provider_x509_certificates():
    """
    This task renews the x509 Service Provider certificates one week before
    they expire (so that there is ample time to respond if there is a problem).
    """
    in_one_week = datetime.datetime.utcnow() + datetime.timedelta(days=7)
    for idp in IdentityProvider.objects.filter(
        sp_rollover_cert_public__isnull=False,
        date_sp_cert_expiration__lte=in_one_week
    ).all():
        idp.renew_service_provider_certificate()
def renew_service_provider_x509_certificates ( ) : in_one_week = datetime . datetime . utcnow ( ) + datetime . timedelta ( days = 7 ) for idp in IdentityProvider . objects . filter ( sp_rollover_cert_public__isnull = False , date_sp_cert_expiration__lte = in_one_week ) . all ( ) : idp . renew_service_provider_certificate ( )