Commit 0ef7d002 by Máhonfai Bálint

Handle if user doesn't have org id when importing group

parent ede21ee9
...@@ -339,8 +339,9 @@ class GroupProfile(AclBase): ...@@ -339,8 +339,9 @@ class GroupProfile(AclBase):
for org_id in data["users"]: for org_id in data["users"]:
try: try:
user = Profile.objects.get(org_id=org_id).user if org_id is not None:
user.groups.add(group) user = Profile.objects.get(org_id=org_id).user
user.groups.add(group)
except ObjectDoesNotExist: except ObjectDoesNotExist:
future_member = FutureMember(org_id=org_id, group=group) future_member = FutureMember(org_id=org_id, group=group)
future_member.save() future_member.save()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment