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): ...@@ -813,7 +813,11 @@ class DistrictPeoplePage(MainPeoplePageMixin):
if team["roles"] is None: if team["roles"] is None:
continue continue
unique_teams[position]["roles"] = team["roles"].split(",") unique_teams[position]["roles"] = (
team["roles"].split(",")
if team["roles"]
else None
)
return unique_teams return unique_teams
......
...@@ -38,6 +38,7 @@ class ImporterMixin: ...@@ -38,6 +38,7 @@ class ImporterMixin:
"username": profile["person"]["username"], "username": profile["person"]["username"],
"email": profile["email"], "email": profile["email"],
"phone": profile["phone"], "phone": profile["phone"],
"position": profile.get("position"),
"facebook_url": profile["facebookUrl"], "facebook_url": profile["facebookUrl"],
"flickr_url": profile["flickrUrl"], "flickr_url": profile["flickrUrl"],
"instagram_url": profile["instagramUrl"], "instagram_url": profile["instagramUrl"],
...@@ -459,6 +460,8 @@ class PeopleTeamImporter(ImporterMixin): ...@@ -459,6 +460,8 @@ class PeopleTeamImporter(ImporterMixin):
key=lambda membership: int(membership.get("roleOrder", 0)), key=lambda membership: int(membership.get("roleOrder", 0)),
reverse=True reverse=True
): ):
print(self.team_roles, membership)
# Can't do this in the query (yet), so just filter here # 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: 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