From 3e6d581f737a8f027661b543cb4df6157bf37e2e Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 7 Nov 2016 15:20:53 +0000 Subject: [PATCH] Use constants for template type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Handy if we ever want to rename these I guess… --- app/schemas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/schemas.py b/app/schemas.py index 7f52b9541..a9811dfc3 100644 --- a/app/schemas.py +++ b/app/schemas.py @@ -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')