Skip to content
Snippets Groups Projects
Commit 1b0a0ad5 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 98dcfc5d
No related branches found
No related tags found
1 merge request!21Add API documentation
......@@ -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