Refactor code to check whether email/sms is enabled

This commit is contained in:
Katie Smith
2017-07-04 17:25:35 +01:00
parent 42a8474415
commit aaadd867f7
3 changed files with 19 additions and 16 deletions

View File

@@ -320,3 +320,7 @@ def get_time_left(created_at):
past_tense='Data no longer available', # No-one should ever see this
precision=1
)
def email_or_sms_not_enabled(template_type, permissions):
return (template_type in ['email', 'sms']) and (template_type not in permissions)