Refactored to make code clearer

This commit is contained in:
Ken Tsang
2017-06-29 18:02:21 +01:00
committed by venusbb
parent e0fbcb0dc6
commit 0b3277b8a4
6 changed files with 47 additions and 46 deletions

View File

@@ -77,3 +77,12 @@ def get_london_month_from_utc_column(column):
def cache_key_for_service_template_counter(service_id, limit_days=7):
return "{}-template-counter-limit-{}-days".format(service_id, limit_days)
def get_public_notify_type_text(notify_type, plural=False):
from app.models import SMS_TYPE
notify_type_text = notify_type
if notify_type == SMS_TYPE:
notify_type_text = 'text message'
return '{}{}'.format(notify_type_text, 's' if plural else '')