From 705a0e7ab887060f0777b57b8b6149c292c7d98a Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 7 Nov 2016 15:21:48 +0000 Subject: [PATCH] Remove redundant assignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This variable is used exactly once, on the next line 🤔 --- app/schemas.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/schemas.py b/app/schemas.py index a9811dfc3..610683a2d 100644 --- a/app/schemas.py +++ b/app/schemas.py @@ -212,8 +212,7 @@ class TemplateSchema(BaseTemplateSchema): @validates_schema def validate_type(self, data): - template_type = data.get('template_type') - if template_type and template_type == models.EMAIL_TYPE: + if data.get('template_type') in [models.EMAIL_TYPE, models.LETTER_TYPE]: subject = data.get('subject') if not subject or subject.strip() == '': raise ValidationError('Invalid template subject', 'subject')