Skip to content
Snippets Groups Projects
Verified Commit e6022680 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

refactor: simplify the code

parent 064e6151
No related branches found
No related tags found
No related merge requests found
Pipeline #7591 passed
......@@ -1016,10 +1016,8 @@ class NoteSerializer(serializers.ModelSerializer):
links_data = validated_data.pop("links", [])
# required
if "timeslot" in validated_data:
validated_data["timeslot"] = validated_data.pop("timeslot")
else:
# TODO: Once we remove nested routes, this hack should be removed
# TODO: Once we remove nested routes, this hack should be removed
if "timeslot" not in validated_data:
timeslot_pk = TimeSlot.objects.get(pk=self.context["request"].path.split("/")[-3])
validated_data["timeslot"] = validated_data.pop("timeslot", timeslot_pk)
......
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