Skip to content

Commit

Permalink
Merge pull request #1231 from adnankattekaden/dev
Browse files Browse the repository at this point in the history
lc lead name issue
  • Loading branch information
adnankattekaden authored Oct 7, 2023
2 parents 6a6cacd + 70f4f49 commit 9aa5002
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 9aa5002

Please sign in to comment.