Esempio n. 1
0
    def test_get_reviewer(self):
        self.assertIsNone(
            reviewer.get_reviewer(self.conference.key, "*****@*****.**"))

        reviewer.make_new_reviewer(self.conference.key, "*****@*****.**")
        r = reviewer.get_reviewer(self.conference.key, "*****@*****.**")
        self.assertIsNotNone(r)
        self.assertEquals("*****@*****.**", r.email)
Esempio n. 2
0
def reviewer_complete_description(conf_key, email, rev_round):
    person = reviewer.get_reviewer(conf_key, email)
    if person is None:
        return ""

    if person.is_complete(rev_round):
        return "Complete"

    return ""
Esempio n. 3
0
    def test_get_new_or_existing_reviewer(self):
        r = reviewer.get_reviewer(self.conference.key, "*****@*****.**")
        self.assertIsNone(r)

        r = reviewer.get_new_or_existing_reviewer(self.conference.key,
                                                  "*****@*****.**")
        self.assertIsNotNone(r)

        q = reviewer.get_new_or_existing_reviewer(self.conference.key,
                                                  "*****@*****.**")
        self.assertIsNotNone(q)
        self.assertEquals(q, r)
Esempio n. 4
0
    def get(self):
        crrt_conf = self.get_crrt_conference_key().get()

        rights = crrt_conf.user_rights()
        review_tracks = rights.tracks_to_review(self.get_crrt_user().email())

        if self.request.params.has_key("track"):
            crrt_track = self.request.get("track")
        else:
            if len(review_tracks) > 0:
                # no key so default to first track in list
                crrt_track = review_tracks[0]
            else:
                # no tracks or no review rights
                crrt_track = "None"  # review_tracks[0]
                sorrypage.redirect_sorry(self, "NoTracksAssigned")
                return

        named_reviewer = reviewer.get_reviewer(crrt_conf.key,
                                               self.get_crrt_user().email())
        if named_reviewer is None:
            named_reviewer = reviewer.make_new_reviewer(
                crrt_conf.key,
                self.get_crrt_user().email())

        review_round = int(self.request.get("round"))
        records = named_reviewer.retrieve_review_assignments(
            crrt_track, review_round)

        newscoringconfig = confreviewconfig.get_conference_review_factory(crrt_conf.key). \
            get_round_config(int(self.request.get("round")))
        if newscoringconfig.is_speaker_named():
            show_name = True
        else:
            show_name = False

        template_values = {
            "conference_submissions": map(lambda s: s.get(), records),
            "count_submissions": len(records),
            "selected_conf": crrt_conf.name,
            "useremail": self.get_crrt_user().email(),
            "review_tracks": review_tracks,
            "track_dictionary": crrt_conf.track_options(),
            "selected_track": crrt_track,
            "durations": crrt_conf.duration_options(),
            "review_round": review_round,
            "show_name": show_name
        }

        self.write_page('subreview_lib/newscoringlistpage.html',
                        template_values)
    def get(self):
        conf = self.get_crrt_conference_key().get()
        review_email = self.request.get("reviewer")
        who = reviewer.get_reviewer(conf.key, review_email)

        review_round = int(self.request.get("review_round", 99))
        self.write_page(
            'subreview_lib/assignmentdetailpage.html', {
                "reviewer":
                review_email,
                "review_round":
                review_round,
                "subs_assignments":
                who.retrieve_review_assignments_for_round(review_round),
                "tracks":
                conf.track_options()
            })
Esempio n. 6
0
    def test_remove_review_assisgments(self):
        sub_key1, sub_key2, sub_key3 = self.setup_test_data()

        reviewer1 = reviewer.make_new_reviewer(self.conference.key,
                                               "rimmer@email")
        reviewer1.assign_submission("track", [sub_key1, sub_key3, sub_key2],
                                    review_round=1)
        self.assertItemsEqual([sub_key3, sub_key2, sub_key1],
                              reviewer1.retrieve_review_assignments(
                                  "track", review_round=1))

        reviewer1.remove_assignment("track", review_round=1, target=sub_key1)
        self.assertItemsEqual([sub_key2, sub_key3],
                              reviewer1.retrieve_review_assignments(
                                  "track", review_round=1))

        # Need to requery db to ensure update was made
        # Original version of remove_assignment missed a put() after operation
        refresh_reviewer = reviewer.get_reviewer(self.conference.key,
                                                 "rimmer@email")
        self.assertItemsEqual([sub_key2, sub_key3],
                              refresh_reviewer.retrieve_review_assignments(
                                  "track", review_round=1))
Esempio n. 7
0
def count_assignments(conf_key, name, review_round):
    r = reviewer.get_reviewer(conf_key, name)
    if r is None:
        return 0
    else:
        return r.count_assignments(review_round)
    def remove_selected(self):
        who = reviewer.get_reviewer(self.get_crrt_conference_key(),
                                    self.request.get("reviewer"))

        for s in self.request.get_all("select_for_removal"):
            self.remove_assignment(who, s)