def reject(self, user, reason, silent=False): self.is_rejected = True self.rejection_reason = reason if not silent: log = [u'Day rejected: {}'.format(format_date(self.date).decode('utf-8')), u'Reason: {}'.format(reason)] self.reservation.add_edit_log(ReservationEditLog(user_name=user.full_name, info=log)) from indico.modules.rb.notifications.reservation_occurrences import notify_rejection notify_rejection(self)
def reject(self, user, reason, silent=False): self.state = ReservationOccurrenceState.rejected self.rejection_reason = reason or None signals.rb.booking_occurrence_state_changed.send(self) if not silent: log = ['Day rejected: {}'.format(format_date(self.date)), f'Reason: {reason}'] self.reservation.add_edit_log(ReservationEditLog(user_name=user.full_name, info=log)) from indico.modules.rb.notifications.reservation_occurrences import notify_rejection notify_rejection(self)
def reject(self, user, reason, silent=False): self.state = ReservationOccurrenceState.rejected self.rejection_reason = reason or None signals.rb.booking_occurrence_state_changed.send(self) if not silent: log = [u'Day rejected: {}'.format(format_date(self.date).decode('utf-8')), u'Reason: {}'.format(reason)] self.reservation.add_edit_log(ReservationEditLog(user_name=user.full_name, info=log)) from indico.modules.rb.notifications.reservation_occurrences import notify_rejection notify_rejection(self)
def reject(self, user, reason, silent=False): self.is_rejected = True self.rejection_reason = reason if not silent: log = [u'Day rejected: {}'.format(format_date(self.date)), u'Reason: {}'.format(reason)] self.reservation.add_edit_log(ReservationEditLog(user_name=user.getFullName(), info=log)) # Notification sent only when the reservation is still valid if self.reservation.occurrences.filter_by(is_valid=True).count(): from indico.modules.rb.notifications.reservation_occurrences import notify_rejection notify_rejection(self)