aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMart Raudsepp <leio@gentoo.org>2016-12-04 09:43:13 +0200
committerMart Raudsepp <leio@gentoo.org>2016-12-04 09:43:13 +0200
commit080e857b7081db90f874c73fd271d8bd699195d6 (patch)
tree415469786a8d698affaf81c767c5481213a4b4f9
parentfrontend: Add meta charset=utf-8 head tag (diff)
downloadgrumpy-080e857b7081db90f874c73fd271d8bd699195d6.tar.gz
grumpy-080e857b7081db90f874c73fd271d8bd699195d6.tar.bz2
grumpy-080e857b7081db90f874c73fd271d8bd699195d6.zip
sync: Update individual maintainer names during projects sync for the time being
... until we don't have master data for this that we shouldn't overwrite. Also remove a now done TODO item and tweak a debug string I messed up pre-commit.
-rw-r--r--backend/lib/sync.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/backend/lib/sync.py b/backend/lib/sync.py
index 57a7cb1..4894315 100644
--- a/backend/lib/sync.py
+++ b/backend/lib/sync.py
@@ -37,7 +37,6 @@ def get_project_data():
if member_tag in ['email', 'name', 'role']:
member[member_tag] = member_elem.text
if 'email' in member:
- # TODO: Sync the members (it's valid as email is given) - maybe at the end, after we have synced the project data, so we can add him to the project directly
if 'members' not in proj:
proj['members'] = []
proj['members'].append(member)
@@ -94,9 +93,12 @@ def sync_projects():
if 'members' in data:
for member in data['members']:
if member['email'] in existing_maintainers:
+ # TODO: Stop overwriting the name from master data, if/once we have a proper sync source for individual maintainers (Gentoo LDAP?)
+ if 'name' in member:
+ existing_maintainers[member['email']].name = member['name']
members.append(existing_maintainers[member['email']])
else:
- print("Adding individual %s" % member['email'])
+ print("Adding individual maintainer %s" % member['email'])
new_maintainer = Maintainer(email=member['email'], is_project=False, name=member['name'] if 'name' in member else None)
db.session.add(new_maintainer)
existing_maintainers[member['email']] = new_maintainer