diff --git a/lemur/certificates/schemas.py b/lemur/certificates/schemas.py index 72ffb063..688d6ba4 100644 --- a/lemur/certificates/schemas.py +++ b/lemur/certificates/schemas.py @@ -194,7 +194,7 @@ class CertificateEditInputSchema(CertificateSchema): # Add required role owner_role = roles_service.get_or_create( data["owner"], - description="Auto generated role based on owner: {0}".format(data["owner"]) + description=f"Auto generated role based on owner: {data['owner']}" ) # Put role info in correct format using RoleNestedOutputSchema @@ -210,7 +210,7 @@ class CertificateEditInputSchema(CertificateSchema): def enforce_notifications(self, data): """ Add default notification for current owner if none exist. - This ensures that the default notifications are added in the even of owner change. + This ensures that the default notifications are added in the event of owner change. Old owner notifications are retained unless explicitly removed later in the code path. :param data: :return: diff --git a/lemur/certificates/service.py b/lemur/certificates/service.py index 812ec101..6d1bd2ac 100644 --- a/lemur/certificates/service.py +++ b/lemur/certificates/service.py @@ -258,9 +258,7 @@ def update(cert_id, **kwargs): def cleanup_owner_roles_notification(owner_name, kwargs): kwargs["roles"] = [r for r in kwargs["roles"] if r.name != owner_name] - notification_prefix = "DEFAULT_{0}".format( - owner_name.split("@")[0].upper() - ) + notification_prefix = f"DEFAULT_{owner_name.split('@')[0].upper()}" kwargs["notifications"] = [n for n in kwargs["notifications"] if not n.label.startswith(notification_prefix)] @@ -279,9 +277,7 @@ def create_certificate_roles(**kwargs): # create a role for the owner and assign it owner_role = role_service.get_or_create( kwargs["owner"], - description="Auto generated role based on owner: {0}".format( - kwargs["owner"] - ) + description=f"Auto generated role based on owner: {kwargs['owner']}" ) # ensure that the authority's owner is also associated with the certificate