Skip to content

Commit

Permalink
Merge pull request #1392 from gtech-mulearn/dev
Browse files Browse the repository at this point in the history
profile mentor fix
  • Loading branch information
adnankattekaden authored Oct 22, 2023
2 parents 4860118 + 013bf90 commit 549b086
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions api/dashboard/profile/profile_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,10 @@ def get_college_id(self, obj):
return user_org_link.org.id if user_org_link else None

def get_org_district_id(self, obj):
org_type = (
OrganizationType.COMPANY.value
if MainRoles.MENTOR.value in self.get_roles(obj)
else OrganizationType.COLLEGE.value
)
user_org_link = obj.user_organization_link_user.filter(
org__org_type=org_type
).first()

return user_org_link.org.district.id if (user_org_link and user_org_link.org.district) else None
org_type = OrganizationType.COMPANY.value if MainRoles.MENTOR.value in self.get_roles(
obj) else OrganizationType.COLLEGE.value
user_org_link = obj.user_organization_link_user.filter(org__org_type=org_type).first()
return user_org_link.org.district.id if user_org_link and hasattr(user_org_link.org, 'district') else None

def get_college_code(self, obj):
if user_org_link := obj.user_organization_link_user.filter(
Expand Down

0 comments on commit 549b086

Please sign in to comment.