Skip to content
Snippets Groups Projects
Commit 832ffc1c authored by borzechof99's avatar borzechof99 :whale2:
Browse files

Use get_rating for Sport-Criterion connection in Serializer

parent 85899ce9
No related branches found
No related tags found
No related merge requests found
......@@ -70,11 +70,7 @@ class SingleSportSerializer(serializers.BaseSerializer):
criterion_data["pk"] = criterion.pk
criterion_data["name"] = criterion.name
# The iterator iterates over the Criterions connected, and not the criterion connection itself, so we need to get that one again
# TODO: Use get_rating of the Sport object
criterion_data["value"] = CriterionRating.objects.get(
criterion=criterion.pk, sport=sport.pk
).rating
criterion_data["value"] = sport.get_rating(criterion)
criteria.append(criterion_data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment