From ec7d9b1c6e49f427f5966a0a9187cbb5b4ca66e8 Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Wed, 1 Jun 2016 13:55:04 +0100 Subject: [PATCH] Use a more pythonic way to compare the dicts. --- app/template/rest.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/template/rest.py b/app/template/rest.py index 94a51a749..168d483ea 100644 --- a/app/template/rest.py +++ b/app/template/rest.py @@ -121,10 +121,7 @@ def _strip_html(content): def _template_has_not_changed(current_data, updated_template): - if (current_data['name'] == updated_template['name'] and - current_data['content'] == updated_template['content'] and - current_data['subject'] == updated_template['subject']and - current_data['archived'] == updated_template['archived']): - return True - else: - return False + return all( + current_data[key] == updated_template[key] + for key in ('name', 'content', 'subject', 'archived') + )