Exemple #1
0
    def _migrate_papers(self):
        self.contrib_reviewers = _invert_mapping(self.pr._reviewerContribution)
        self.contrib_referees = _invert_mapping(self.pr._refereeContribution)
        self.contrib_editors = _invert_mapping(self.pr._editorContribution)

        for contrib_id, old_contrib in self.conf.contributions.iteritems():
            if old_contrib not in self.event_ns.legacy_contribution_map:
                self.print_warning(
                    '%[yellow!]Contribution {} not found in event'.format(
                        contrib_id))
                continue

            contribution = self.event_ns.legacy_contribution_map[old_contrib]
            revisions = Paper(contribution).revisions
            self._migrate_paper_roles(old_contrib, contribution)

            review_manager = getattr(old_contrib, '_reviewManager', None)
            if review_manager:
                self._migrate_revisions(old_contrib, contribution,
                                        review_manager)

            reviewing = getattr(old_contrib, 'reviewing', None)

            # if there were no materials attached to the contribution or no revisions, we're done
            if not reviewing or not revisions:
                continue

            # these are the resources that correspond to the latest revision
            for resource in reviewing._Material__resources.itervalues():
                self._migrate_resource(
                    contribution, revisions[-1], resource,
                    getattr(reviewing, '_modificationDS', strict_now_utc()),
                    set())
Exemple #2
0
 def _process(self):
     form = PaperSubmissionForm()
     if form.validate_on_submit():
         paper = Paper(self.contribution)
         create_paper_revision(paper, session.user, form.files.data)
         return jsonify_data(flash=False)
     return jsonify_form(
         form,
         form_header_kwargs={'action': request.relative_url},
         disable_if_locked=False)
Exemple #3
0
 def _process(self):
     form = PaperSubmissionForm()
     if form.validate_on_submit():
         if self.paper is None:
             paper = Paper(self.contribution)
             create_paper_revision(paper, session.user, form.files.data)
             return jsonify_data(flash=False)
         else:
             create_paper_revision(self.paper, session.user,
                                   form.files.data)
             return jsonify_data(flash=False,
                                 html=render_paper_page(self.paper))
     return jsonify_form(
         form, form_header_kwargs={'action': request.relative_url})
Exemple #4
0
 def paper(self):
     return Paper(self) if self._paper_last_revision else None
Exemple #5
0
def dummy_paper(dummy_contribution):
    return Paper(dummy_contribution)