示例#1
0
 def accept(self, user):
     self.state = ReservationState.accepted
     self.add_edit_log(ReservationEditLog(user_name=user.full_name, info=['Reservation accepted']))
     notify_confirmation(self)
     signals.rb.booking_state_changed.send(self)
     valid_occurrences = self.occurrences.filter(ReservationOccurrence.is_valid).all()
     pre_occurrences = ReservationOccurrence.find_overlapping_with(self.room, valid_occurrences, self.id).all()
     for occurrence in pre_occurrences:
         if not occurrence.is_valid:
             continue
         occurrence.reject(user, u'Rejected due to collision with a confirmed reservation')
示例#2
0
    def accept(self, user):
        self.is_accepted = True
        self.add_edit_log(ReservationEditLog(user_name=user.full_name, info=["Reservation accepted"]))
        notify_confirmation(self)

        valid_occurrences = self.occurrences.filter(ReservationOccurrence.is_valid).all()
        pre_occurrences = ReservationOccurrence.find_overlapping_with(self.room, valid_occurrences, self.id).all()
        for occurrence in pre_occurrences:
            if not occurrence.is_valid:
                continue
            occurrence.reject(user, u"Rejected due to collision with a confirmed reservation")
示例#3
0
 def accept(self, user, reason=None):
     self.state = ReservationState.accepted
     if reason:
         log_msg = f'Reservation accepted: {reason}'
     else:
         log_msg = 'Reservation accepted'
     self.add_edit_log(ReservationEditLog(user_name=user.full_name, info=[log_msg]))
     notify_confirmation(self, reason)
     signals.rb.booking_state_changed.send(self)
     pre_occurrences = get_prebooking_collisions(self)
     for occurrence in pre_occurrences:
         occurrence.reject(user, 'Rejected due to collision with a confirmed reservation')
示例#4
0
    def accept(self, user):
        self.is_accepted = True
        self.add_edit_log(
            ReservationEditLog(user_name=user.getFullName(),
                               info=['Reservation accepted']))
        notify_confirmation(self)

        valid_occurrences = self.occurrences.filter(
            ReservationOccurrence.is_valid).all()
        pre_occurrences = ReservationOccurrence.find_overlapping_with(
            self.room, valid_occurrences, self.id).all()
        for occurrence in pre_occurrences:
            if not occurrence.is_valid:
                continue
            occurrence.reject(
                user,
                u'Rejected due to collision with a confirmed reservation')