Comment 1 for bug 117817

Revision history for this message
sainrat (sainrat) wrote :

    def getConflictingEvents(self, resource):
        """Return a list of events that would conflict when booking resource."""
        events = []
        if not canAccess(resource.calendar, "expand"):
            return events
           if self.context.recurrence:
          totest = []
          for d in self.context.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))
        else:
          totest = [self.context.dtstart]
        for d in totest:
          for event in resource.calendar.expand(d,d + self.context.duration):
            if event != self.context:
                  events.append(EventForBookingDisplay(event))
        return events