Skip to content

Commit

Permalink
fix: fixes post create tournament not returning position_set
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelobbfonseca committed Dec 14, 2023
1 parent 16ed02b commit a7414e2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions eliminationtournaments/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ def get_position_set(self, instance: Tournament):
positions = instance.position_set.all().order_by('bracket_index')
return PositionSerializer(positions, many=True, read_only=True).data

if 'pk' in request.parser_context['kwargs']:
if 'pk' in request.parser_context['kwargs'] or request.method == 'POST':
positions = instance.position_set.all().order_by('bracket_index')
return PositionSerializer(positions, many=True, read_only=True).data

return []

0 comments on commit a7414e2

Please sign in to comment.