Unable to create repetition schedule
The dashboard currently allows users to create a repetition schedule when selecting a timeslot in the calendar area.
The POST
request to the /api/v1/schedules/
-endpoint with the following payload triggers a 500
-error in steering with an uncaught exception:
{
"schedule": {
"addBusinessDaysOnly": false,
"addDaysNo": 1,
"showId": 45,
"isRepetition": true,
"firstDate": "2025-01-17",
"startTime": "08:45:00",
"endTime": "10:15:00",
"rruleId": 1,
"lastDate": null,
"defaultPlaylistId": null,
"byWeekday": 4
}
}
The original schedule has just a single timeslot (rrule is once). I’m adding a repetition schedule for the next day. The request triggers a TypeError
in line 538
of the generate_timeslots
function (>
not supported between instances of datetime.date
and NoneType
).
I have a few thoughts:
- Is it helpful that steering has to figure out the repetition? Couldn’t the dashboard just create a regular schedule and add the appropriate number of days to the
firstDate
property? - We only expose that the schedule is a repetition (
isRepetition
). Wouldn’t it be nice to know which schedule is actually being repeated?
If steering should figure out the repetition and the information which schedule is repeated is useful, we might as well create an endpoint like this:
# POST /api/v1/schedules/4/repeat
{
"addBusinessDaysOnly": false,
"addDaysNo": 1
}
The request would return a conflict resolution response like POST /api/v1/schedules/
does.