fix: be more sure to create interim's timeslot / update duration (#4846)
This commit is contained in:
parent
a7c0cc0464
commit
40fd46a293
|
@ -1060,7 +1060,6 @@ def sessions_post_save(request, forms):
|
|||
by=request.user.person,
|
||||
)
|
||||
|
||||
if ('date' in form.changed_data) or ('time' in form.changed_data):
|
||||
update_interim_session_assignment(form)
|
||||
if 'agenda' in form.changed_data:
|
||||
form.save_agenda()
|
||||
|
@ -1140,6 +1139,8 @@ def update_interim_session_assignment(form):
|
|||
"""Helper function to create / update timeslot assigned to interim session
|
||||
|
||||
form is an InterimSessionModelForm
|
||||
|
||||
Only updates timeslot time (a datetime) and duration
|
||||
"""
|
||||
session = form.instance
|
||||
meeting = session.meeting
|
||||
|
@ -1148,6 +1149,7 @@ def update_interim_session_assignment(form):
|
|||
)
|
||||
if session.official_timeslotassignment():
|
||||
slot = session.official_timeslotassignment().timeslot
|
||||
if slot.time != time or slot.duration != session.requested_duration:
|
||||
slot.time = time
|
||||
slot.duration = session.requested_duration
|
||||
slot.save()
|
||||
|
|
Loading…
Reference in a new issue