[FIX] calendar: do not crash on all day selection
While start and stop are required fields, it is possible to trigger the computation from the UI before saving (e.g. create an event, set no date, check "all day" checkbox). Fixes #27265
This commit is contained in:
@@ -874,7 +874,7 @@ class Meeting(models.Model):
|
||||
the duration for not allday meeting ; otherwise the duration is set to zero, since the meeting last all the day.
|
||||
"""
|
||||
for meeting in self:
|
||||
if meeting.allday:
|
||||
if meeting.allday and meeting.start and meeting.stop:
|
||||
meeting.start_date = meeting.start.date()
|
||||
meeting.start_datetime = False
|
||||
meeting.stop_date = meeting.stop.date()
|
||||
|
||||
Reference in New Issue
Block a user