Use constants for template type

Handy if we ever want to rename these I guess…
This commit is contained in:
Chris Hill-Scott
2016-11-07 15:20:53 +00:00
parent eb17822564
commit 3e6d581f73

View File

@@ -213,7 +213,7 @@ class TemplateSchema(BaseTemplateSchema):
@validates_schema
def validate_type(self, data):
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')
if not subject or subject.strip() == '':
raise ValidationError('Invalid template subject', 'subject')