Beispiel #1
0
    def _review(self, id):
        """Review a proposal.
        """
        c.proposal = Proposal.find_by_id(id)
        c.signed_in_person = h.signed_in_person()
        c.next_review_id = Proposal.find_next_proposal(c.proposal.id, c.proposal.type.id, c.signed_in_person.id)

        c.review = Review.find_by_proposal_reviewer(id, c.signed_in_person.id, abort_404=False)
        if c.review:
            for key in self.form_result['review']:
                setattr(c.review, key, self.form_result['review'][key])

            # update the objects with the validated form data
            meta.Session.commit()
            h.flash("Review Updated Successfully")
            return redirect_to(controller='review', action='view', id=c.review.id)

        else:
            results = self.form_result['review']
            review = Review(**results)

            meta.Session.add(review)
            review.proposal = c.proposal
            review.reviewer = c.signed_in_person

            meta.Session.commit()
            h.flash("Review Added Successfully")

        if c.next_review_id:
            return redirect_to(action='review', id=c.next_review_id)

        h.flash("No more papers to review")

        return redirect_to(action='review_index')
Beispiel #2
0
    def _review(self, id):
        """Review a proposal.
        """
        c.proposal = Proposal.find_by_id(id)
        c.signed_in_person = h.signed_in_person()
        c.next_review_id = Proposal.find_next_proposal(c.proposal.id, c.proposal.type.id, c.signed_in_person.id)

        c.review = Review.find_by_proposal_reviewer(id, c.signed_in_person.id, abort_404=False)
        if c.review:
            for key in self.form_result['review']:
                setattr(c.review, key, self.form_result['review'][key])

            # update the objects with the validated form data
            meta.Session.commit()
            h.flash("Review Updated Successfully")
            return redirect_to(controller='review', action='view', id=c.review.id)

        else:
            results = self.form_result['review']
            review = Review(**results)

            meta.Session.add(review)
            review.proposal = c.proposal
            review.reviewer = c.signed_in_person

            meta.Session.commit()
            h.flash("Review Added Successfully")

        if c.next_review_id:
            return redirect_to(action='review', id=c.next_review_id)

        h.flash("No more proposals to review")

        return redirect_to(action='review_index')