mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 10:28:55 -04:00
Use constants for template type
Handy if we ever want to rename these I guess…
This commit is contained in:
+1
-1
@@ -213,7 +213,7 @@ class TemplateSchema(BaseTemplateSchema):
|
|||||||
@validates_schema
|
@validates_schema
|
||||||
def validate_type(self, data):
|
def validate_type(self, data):
|
||||||
template_type = data.get('template_type')
|
template_type = data.get('template_type')
|
||||||
if template_type and template_type == 'email':
|
if template_type and template_type == models.EMAIL_TYPE:
|
||||||
subject = data.get('subject')
|
subject = data.get('subject')
|
||||||
if not subject or subject.strip() == '':
|
if not subject or subject.strip() == '':
|
||||||
raise ValidationError('Invalid template subject', 'subject')
|
raise ValidationError('Invalid template subject', 'subject')
|
||||||
|
|||||||
Reference in New Issue
Block a user