Skip to content

Commit

Permalink
Merge pull request #163 from enesonus/OVTF-258-dev
Browse files Browse the repository at this point in the history
OVTF-258-dev: Bug Fix
  • Loading branch information
bilalbdertli authored Jan 20, 2024
2 parents 3fd8a6e + fbc02bf commit 226697d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apps/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2354,9 +2354,13 @@ def get_playlists_of_group(request, userid):
if group_id is None or not isinstance(group_id, int):
return JsonResponse({'error': 'Please check the group id field.'}, status=400)
friend_group = FriendGroup.objects.get(id=group_id)
playlists = friend_group.playlists.all()
serialized_playlists = [serializePlaylist(playlist) for playlist in playlists]
return JsonResponse({'playlists': serialized_playlists}, status=200)
playlists = friend_group.playlists.order_by('-updated_at').all()
data = []
for playlist in playlists:
serialized_pl = serializePlaylistInfo(playlist)
data.append(serialized_pl)
return JsonResponse({'items': data, 'count': len(data)}, status=200)
#return JsonResponse({'playlists': serialized_playlists}, status=200)
except ValueError:
return JsonResponse({'error': 'Invalid parameters'}, status=400)
except FriendGroup.DoesNotExist:
Expand Down

0 comments on commit 226697d

Please sign in to comment.