Files
notifications-admin/app/url_converters.py
Chris Hill-Scott 697803a10c Add a ‘general’ ticket type
This is for tickets coming from non-logged-in users. It’s effectively
the same as reporting a problem, but doesn’t have the banner about
the status page (because we can’t tell if they’re actually reporting a
problem now we’re not asking).

It also gives a more generic page title.
2020-03-24 17:56:11 +00:00

27 lines
562 B
Python

from werkzeug.routing import BaseConverter
from app.models.feedback import (
GENERAL_TICKET_TYPE,
PROBLEM_TICKET_TYPE,
QUESTION_TICKET_TYPE,
)
class TemplateTypeConverter(BaseConverter):
regex = '(?:email|sms|letter)'
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]))'