mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05:00
23 lines
548 B
Python
23 lines
548 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 SimpleDateTypeConverter(BaseConverter):
|
|
regex = r'([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))'
|