aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMunyoki Kilyungi2022-09-01 17:15:06 +0300
committerBonfaceKilz2022-09-08 14:26:19 +0300
commite3916e6403b8933d9d8896b7289321c45b9990d2 (patch)
tree04a2a025bfb58c900cf48cdb0336caafe5472d5f
parentb45caa10e7896cae614109c86a55c475c47de01a (diff)
downloadgenenetwork2-e3916e6403b8933d9d8896b7289321c45b9990d2.tar.gz
Refactor if clause to check for string in list
* wqflask/wqflask/docs.py (update_text): Check for the e-mail in a list.
-rw-r--r--wqflask/wqflask/docs.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/wqflask/wqflask/docs.py b/wqflask/wqflask/docs.py
index 06f83c7f..5065135b 100644
--- a/wqflask/wqflask/docs.py
+++ b/wqflask/wqflask/docs.py
@@ -31,9 +31,8 @@ def update_text(start_vars):
content = start_vars['ckcontent']
content = content.replace('%', '%%').replace(
'"', '\\"').replace("'", "\\'")
-
try:
- if g.user_session.record['user_email_address'] == "zachary.a.sloan@gmail.com" or g.user_session.record['user_email_address'] == "labwilliams@gmail.com":
+ if g.user_session.record.get('user_email_address') in ["zachary.a.sloan@gmail.com", "labwilliams@gmail.com"]:
with database_connection() as conn, conn.cursor() as cursor:
cursor.execute("UPDATE Docs SET content=%s WHERE entry=%s",
(content, start_vars.get("entry_type"),))