Skip to content
Snippets Groups Projects
Commit addf232f authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

fix: always include API fields

Simply omitting properties in the API in certain edge cases makes API
client implementations brittle and documentation a lot harder.
parent 89269076
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !21. Comments created here will be created in the context of that merge request.
......@@ -526,10 +526,10 @@ class Schedule(models.Model):
# Get note
try:
note = Note.objects.get(timeslot=c.id).values_list("id", flat=True)
collision["note_id"] = note
note = Note.objects.get(timeslot=c.id)
collision["note_id"] = note.pk
except ObjectDoesNotExist:
pass
collision["note_id"] = None
collisions.append(collision)
......@@ -607,6 +607,7 @@ class Schedule(models.Model):
projected_entry["collisions"] = collisions
projected_entry["solution_choices"] = solution_choices
projected_entry["error"] = None
projected.append(projected_entry)
conflicts["projected"] = projected
......
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