From cbbf78c2a199b6d82c2b7e1257e5c54f5c197fb3 Mon Sep 17 00:00:00 2001 From: ariannedee Date: Tue, 11 Aug 2020 16:40:56 -0700 Subject: [PATCH] Fix some Python3.6 syntax so it works in 3.5 --- edivorce/apps/core/templatetags/input_field.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/edivorce/apps/core/templatetags/input_field.py b/edivorce/apps/core/templatetags/input_field.py index df4703d5..63dbdb9d 100644 --- a/edivorce/apps/core/templatetags/input_field.py +++ b/edivorce/apps/core/templatetags/input_field.py @@ -63,6 +63,13 @@ def input_field(context, type, name='', value='', multiple='', **kwargs): """ Usage: when specifying data attributes in templates, use "data_" instead of "data-". """ + error = context.get(name + '_error', False) + if error: + if 'class' in kwargs: + kwargs['class'] += ' error' + else: + kwargs['class'] = 'error' + if type == "textarea": attributes = additional_attributes(**kwargs) if value == '':