mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05:00
At the moment the page is the same as for text message templates, except: - different H1 - no guidance about personalisation, links, etc (until we decide how these should work) For now you won’t be able to really create a broadcast template, because the API doesn’t support it (the API will respond with a 400). But that’s OK because no real services have the broadcast permission yet. This required a bit of refactoring of how we check which template types a service can use, because there were some hard-coded assumptions about emails and text messages.
28 lines
628 B
Python
28 lines
628 B
Python
from werkzeug.routing import BaseConverter
|
|
|
|
from app.models.feedback import (
|
|
GENERAL_TICKET_TYPE,
|
|
PROBLEM_TICKET_TYPE,
|
|
QUESTION_TICKET_TYPE,
|
|
)
|
|
from app.models.service import Service
|
|
|
|
|
|
class TemplateTypeConverter(BaseConverter):
|
|
|
|
regex = '(?:{})'.format('|'.join(Service.TEMPLATE_TYPES))
|
|
|
|
|
|
class TicketTypeConverter(BaseConverter):
|
|
|
|
regex = f'(?:{PROBLEM_TICKET_TYPE}|{QUESTION_TICKET_TYPE}|{GENERAL_TICKET_TYPE})'
|
|
|
|
|
|
class LetterFileExtensionConverter(BaseConverter):
|
|
|
|
regex = '(?:pdf|png)'
|
|
|
|
|
|
class SimpleDateTypeConverter(BaseConverter):
|
|
regex = r'([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))'
|