Skip to content

Commit

Permalink
Fix latest posts feed title
Browse files Browse the repository at this point in the history
  • Loading branch information
olarid7852 committed Dec 18, 2024
1 parent 80c5b19 commit ccaea30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/obstracts_api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def list(self, *args, **kwargs):
subscriptions = FeedSubsription.objects.filter(team_id=team_id).select_related('feed')
feed_ids = [subscription.feed_id for subscription in subscriptions]
for subscription in subscriptions:
feed_title_dict[subscription.feed_id] = subscription.feed.obstract_feed_metadata.get('title')
feed_title_dict[str(subscription.feed_id)] = subscription.feed.obstract_feed_metadata.get('title')
else:
if not self.request.user.is_staff:
raise PermissionDenied()
Expand All @@ -320,7 +320,7 @@ def list(self, *args, **kwargs):
post_feed_ids = [post['feed_id'] for post in posts]
feeds = Feed.objects.filter(id__in=post_feed_ids)
for feed in feeds:
feed_title_dict[feed_id] = feed.obstract_feed_metadata.get('title')
feed_title_dict[str(feed.id)] = feed.obstract_feed_metadata.get('title')
for post in posts:
post['feed_title'] = feed_title_dict.get(post['feed_id'])
return Response(response)
Expand Down

0 comments on commit ccaea30

Please sign in to comment.