aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Dartiguelongue <eva@gentoo.org>2017-01-22 13:34:13 +0100
committerGilles Dartiguelongue <eva@gentoo.org>2017-01-22 13:34:13 +0100
commitf969ccffe04df2d1eeb014dfe67d58177da476fb (patch)
treee3876588561f28eebdbfa5d3eddcb64acc098c92
parentsync: replace assert with ValueError raise (diff)
downloadgrumpy-f969ccffe04df2d1eeb014dfe67d58177da476fb.tar.gz
grumpy-f969ccffe04df2d1eeb014dfe67d58177da476fb.tar.bz2
grumpy-f969ccffe04df2d1eeb014dfe67d58177da476fb.zip
sync: reduce unneeded conditional evaluation
tags cannot be evaluated to go though these branches after the first if so switch to elif.
-rw-r--r--backend/lib/sync.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/lib/sync.py b/backend/lib/sync.py
index 429d14b..4cbfe1b 100644
--- a/backend/lib/sync.py
+++ b/backend/lib/sync.py
@@ -36,7 +36,7 @@ def get_project_data():
tag = elem.tag.lower()
if tag in ['email']:
proj[tag] = elem.text.lower()
- if tag in ['name', 'url', 'description']:
+ elif tag in ['name', 'url', 'description']:
proj[tag] = elem.text
elif tag == 'member':
member = {}
@@ -46,7 +46,7 @@ def get_project_data():
member_tag = member_elem.tag.lower()
if member_tag in ['email']:
member[member_tag] = member_elem.text.lower()
- if member_tag in ['name', 'role']:
+ elif member_tag in ['name', 'role']:
member[member_tag] = member_elem.text
if 'email' in member:
proj['members'].append(member)