Skip to content
Snippets Groups Projects
Commit ddab0aa5 authored by Alexa Valentová's avatar Alexa Valentová
Browse files

fix team imports

parent b85bf51c
No related branches found
No related tags found
2 merge requests!1185Release,!1184fix team imports
Pipeline #20068 passed
......@@ -813,7 +813,11 @@ class DistrictPeoplePage(MainPeoplePageMixin):
if team["roles"] is None:
continue
unique_teams[position]["roles"] = team["roles"].split(",")
unique_teams[position]["roles"] = (
team["roles"].split(",")
if team["roles"]
else None
)
return unique_teams
......
......@@ -38,6 +38,7 @@ class ImporterMixin:
"username": profile["person"]["username"],
"email": profile["email"],
"phone": profile["phone"],
"position": profile.get("position"),
"facebook_url": profile["facebookUrl"],
"flickr_url": profile["flickrUrl"],
"instagram_url": profile["instagramUrl"],
......@@ -459,6 +460,8 @@ class PeopleTeamImporter(ImporterMixin):
key=lambda membership: int(membership.get("roleOrder", 0)),
reverse=True
):
print(self.team_roles, membership)
# Can't do this in the query (yet), so just filter here
if len(self.team_roles) != 0 and membership["roleDisplay"] not in self.team_roles:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment