mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Use hasattr instead of getattr
We don’t need the value returned by `getattr`, so using `hasattr` is cleaner.
This commit is contained in:
@@ -113,7 +113,7 @@ def edit_service_template(service_id, template_id):
|
|||||||
form = form_objects[template['template_type']](**template)
|
form = form_objects[template['template_type']](**template)
|
||||||
|
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
subject = form.subject.data if getattr(form, 'subject', None) else None
|
subject = form.subject.data if hasattr(form, 'subject') else None
|
||||||
new_template = Template({
|
new_template = Template({
|
||||||
'name': form.name.data,
|
'name': form.name.data,
|
||||||
'content': form.template_content.data,
|
'content': form.template_content.data,
|
||||||
|
|||||||
Reference in New Issue
Block a user