()
This task creates a rollover x509 Service Provider certificate two
    weeks before it expires.
This task creates a rollover x509 Service Provider certificate two
    weeks before it expires.
This task creates a rollover x509 Service Provider certificate two weeks before it expires .
def create_rollover_service_provider_x509_certificates():
    """
    This task creates a rollover x509 Service Provider certificate two
    weeks before it expires.
    """
    in_two_weeks = datetime.datetime.utcnow() + datetime.timedelta(days=14)
    for idp in IdentityProvider.objects.filter(
        sp_rollover_cert_public__isnull=True,
        date_sp_cert_expiration__lte=in_two_weeks
    ).all():
        idp.create_rollover_service_provider_certificate()
def create_rollover_service_provider_x509_certificates ( ) : in_two_weeks = datetime . datetime . utcnow ( ) + datetime . timedelta ( days = 14 ) for idp in IdentityProvider . objects . filter ( sp_rollover_cert_public__isnull = True , date_sp_cert_expiration__lte = in_two_weeks ) . all ( ) : idp . create_rollover_service_provider_certificate ( )