Beispiel #1
0
 def _process_DELETE(self):
     """Delete a timetable entry"""
     if self.entry.type == TimetableEntryType.SESSION_BLOCK:
         delete_session_block(self.entry.session_block)
     elif self.event.type != 'conference' and self.entry.type == TimetableEntryType.CONTRIBUTION:
         delete_contribution(self.entry.contribution)
     else:
         delete_timetable_entry(self.entry)
Beispiel #2
0
 def _process(self):
     for contrib in self.contribs:
         delete_contribution(contrib)
     deleted_count = len(self.contribs)
     flash(ngettext("The contribution has been deleted.",
                    "{count} contributions have been deleted.", deleted_count)
           .format(count=deleted_count), 'success')
     return jsonify_data(**self.list_generator.render_list())
Beispiel #3
0
 def _process(self):
     if self.entry.type == TimetableEntryType.SESSION_BLOCK:
         delete_session_block(self.entry.session_block)
     elif self.entry.type == TimetableEntryType.CONTRIBUTION and self.event_new.type != 'conference':
         delete_contribution(self.entry.contribution)
     else:
         delete_timetable_entry(self.entry)
     return jsonify_data(flash=False)
Beispiel #4
0
def delete_abstract(abstract, delete_contrib=False):
    abstract.is_deleted = True
    contrib = abstract.contribution
    abstract.contribution = None
    if delete_contrib and contrib:
        delete_contribution(contrib)
    db.session.flush()
    signals.event.abstract_deleted.send(abstract)
    logger.info('Abstract %s deleted by %s', abstract, session.user)
    abstract.event.log(EventLogRealm.reviewing, EventLogKind.negative, 'Abstracts',
                       'Abstract {} deleted'.format(abstract.verbose_title), session.user)
Beispiel #5
0
def withdraw_abstract(abstract, delete_contrib=False):
    abstract.state = AbstractState.withdrawn
    contrib = abstract.contribution
    abstract.contribution = None
    if delete_contrib and contrib:
        delete_contribution(contrib)
    db.session.flush()
    signals.event.abstract_state_changed.send(abstract)
    logger.info('Abstract %s withdrawn by %s', abstract, session.user)
    abstract.event_new.log(EventLogRealm.management, EventLogKind.negative, 'Abstracts',
                           'Abstract {} withdrawn'.format(abstract.verbose_title), session.user)
Beispiel #6
0
 def _process(self):
     day = self.entry.start_dt.astimezone(self.entry.event_new.tzinfo).date()
     block = self.entry.parent
     if self.entry.type == TimetableEntryType.SESSION_BLOCK:
         delete_session_block(self.entry.session_block)
     elif self.entry.type == TimetableEntryType.CONTRIBUTION and self.event_new.type != 'conference':
         delete_contribution(self.entry.contribution)
     else:
         delete_timetable_entry(self.entry)
     return jsonify_data(update=serialize_day_update(self.event_new, day, block=block, session_=self.session),
                         flash=False)
Beispiel #7
0
def delete_session_block(session_block):
    from indico.modules.events.contributions.operations import delete_contribution
    from indico.modules.events.timetable.operations import delete_timetable_entry
    session_ = session_block.session
    unschedule_contribs = session_.event.type_ == EventType.conference
    for contribution in session_block.contributions[:]:
        contribution.session_block = None
        if unschedule_contribs:
            delete_timetable_entry(contribution.timetable_entry, log=False)
        else:
            delete_contribution(contribution)
    for entry in session_block.timetable_entry.children[:]:
        delete_timetable_entry(entry, log=False)
    delete_timetable_entry(session_block.timetable_entry, log=False)
    signals.event.session_block_deleted.send(session_block)
    if session_block in session_.blocks:
        session_.blocks.remove(session_block)
    if not session_.blocks and session_.event.type != 'conference':
        delete_session(session_)
    db.session.flush()
    logger.info('Session block %s deleted by %s', session_block, session.user)
Beispiel #8
0
 def _process_DELETE(self):
     delete_contribution(self.contrib)
     flash(_("Contribution '{}' successfully deleted").format(self.contrib.title), 'success')
     return jsonify_data(**self.list_generator.render_list())
Beispiel #9
0
 def _removeAssociatedContribution(self):
     delete_contribution(self._abstract.as_new.contribution)
Beispiel #10
0
 def _process_DELETE(self):
     delete_contribution(self.contrib)
     flash(
         _("Contribution '{}' successfully deleted").format(
             self.contrib.title), 'success')
     return jsonify_data(**self.list_generator.render_list())