don't re-delete already archived/revoked templates/api-keys

This commit is contained in:
Leo Hemsted
2016-11-14 14:10:40 +00:00
parent eb17822564
commit d706d86c9c
2 changed files with 40 additions and 4 deletions

View File

@@ -86,10 +86,12 @@ def dao_deactive_service(service_id):
service.email_from = '_archived_' + service.email_from
for template in service.templates:
template.archived = True
if not template.archived:
template.archived = True
for api_key in service.api_keys:
api_key.expiry_date = datetime.utcnow()
if not api_key.expiry_date:
api_key.expiry_date = datetime.utcnow()
def dao_fetch_service_by_id_and_user(service_id, user_id):