double-booking with recurrent events
Bug #117817 reported by
sainrat
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SchoolTool |
Confirmed
|
Wishlist
|
Justas Sadzevičius |
Bug Description
In 0.11.4, If you create a recurring event and book a resource, double booking is detected only on the first occurence of the event not on later occurences. Tested only on weekly events but I believe it's the same everywhere.
I believe the error is in schoolbell/
Changed in schooltool: | |
assignee: | nobody → ignas |
tags: | added: calendar resources |
Changed in schooltool: | |
assignee: | Ignas Mikalajūnas (ignas) → Justas Sadzevičius (justas-pov) |
To post a comment you must log in.
def getConflictingE vents(self, resource): resource. calendar, "expand"): recurrence: recurrence. apply(self. context) :
totest. append( datetime( d.year, d.month, d.day, self.context. dtstart. hour, self.context. dtstart. minute, self.context. dtstart. second, self.context. dtstart. microsecond, self.context. dtstart. tzinfo) ) dtstart] calendar. expand( d,d + self.context. duration) :
events. append( EventForBooking Display( event))
"""Return a list of events that would conflict when booking resource."""
events = []
if not canAccess(
return events
if self.context.
totest = []
for d in self.context.
else:
totest = [self.context.
for d in totest:
for event in resource.
if event != self.context:
return events