Skip to content

Commit

Permalink
Merge pull request #1233 from gtech-mulearn/dev-server
Browse files Browse the repository at this point in the history
LC lead name issue fix
  • Loading branch information
adnankattekaden authored Oct 7, 2023
2 parents 8e1bdd9 + 4bbe16a commit c628da8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api/dashboard/lc/dash_lc_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,11 @@ class Meta:
fields = ['name', 'ig_name', 'member_count', 'members', 'meet_place', 'meet_time', 'lead_name']

def get_lead_name(self, obj):
user = UserCircleLink.objects.filter(circle=obj, accepted=1, lead=True).first().user
return f'{user.first_name} {user.last_name}'
user_circle_link = UserCircleLink.objects.filter(circle=obj, accepted=1, lead=True).first()
if user_circle_link:
user = user_circle_link.user
return f'{user.first_name} {user.last_name}'
return None

def get_ig_name(self, obj):
return obj.ig.name if obj.ig else None
Expand Down

0 comments on commit c628da8

Please sign in to comment.