def cancel(self, user, reason=None, silent=False):
     self.is_cancelled = True
     self.rejection_reason = reason
     if not silent:
         log = [u'Day cancelled: {}'.format(format_date(self.date).decode('utf-8'))]
         if reason:
             log.append(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_cancellation
         notify_cancellation(self)
示例#2
0
 def cancel(self, user, reason=None, silent=False):
     self.state = ReservationOccurrenceState.cancelled
     self.rejection_reason = reason or None
     signals.rb.booking_occurrence_state_changed.send(self)
     if not silent:
         log = ['Day cancelled: {}'.format(format_date(self.date))]
         if reason:
             log.append(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_cancellation
         notify_cancellation(self)
示例#3
0
 def cancel(self, user, reason=None, silent=False):
     self.state = ReservationOccurrenceState.cancelled
     self.rejection_reason = reason or None
     signals.rb.booking_occurrence_state_changed.send(self)
     if not silent:
         log = [u'Day cancelled: {}'.format(format_date(self.date).decode('utf-8'))]
         if reason:
             log.append(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_cancellation
         notify_cancellation(self)
 def cancel(self, user, reason=None, silent=False):
     self.is_cancelled = True
     self.rejection_reason = reason
     if not silent:
         log = [u'Day cancelled: {}'.format(format_date(self.date))]
         if reason:
             log.append(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_cancellation
             notify_cancellation(self)