Skip to content

Commit

Permalink
Add non-existent group exception
Browse files Browse the repository at this point in the history
  • Loading branch information
itsPedro231 committed Nov 20, 2023
1 parent 0083577 commit 49b7910
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/optimeet/groups/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def add_preference_to_group(request, group_id, user_id, format=None):
except models.UserGroup.DoesNotExist:
raise Http404

except models.Group.DoesNotExist:
raise Http404

serializer = serializers.PreferencesSerializer(data=request.data, context={"group_id":group,"user_id":user_id})

if serializer.is_valid():
Expand Down

0 comments on commit 49b7910

Please sign in to comment.