def assign_reviewer(reviewer_email, paper_number): if not check_arguments(reviewer_email, paper_number): return False # check paper_number exists notes = [note for note in submissions if str(note.number) == paper_number] if not notes: print "Error: Paper number " + paper_number + " does not exist" return True note = notes[0] # create list of conflicts emails and add paper author to it # conflict_list is a copy (not a reference) to the submission conflicts conflict_list = [] # If conflicts are a part of a submission, add them here if 'conflicts' in note.content: conflict_list.extend(note.content['conflicts'][:]) # authors for this paper are not allowed to be in the reviewers groups if 'authorids' in note.content: conflict_list += note.content['authorids'] if reviewer_conflicts(reviewer_email, paper_number, conflict_list): return True reviewer_id = tools.get_profile(client, reviewer_email) if reviewer_id is None: reviewer_id = reviewer_email else: reviewer_id = reviewer_id.id tools.assign(client, paper_number, CONFERENCE_ID, reviewer_to_add = reviewer_id) ## reviewers are blocked from other reviews until complete paper_group = CONFERENCE_ID + '/Paper' + paper_number client.add_members_to_group(client.get_group(paper_group + '/Reviewers/NonReaders'), reviewer_id) return True
def assign_reviewer(reviewer_email, paper_number): print(reviewer_email) if not check_arguments(reviewer_email, paper_number): return False # check paper_number exists notes = [note for note in submissions if str(note.number) == paper_number] if not notes: print("Error: Paper number " + paper_number + " does not exist") return True note = notes[0] if reviewer_email in note.content['authorids']: print("Error: Reviewer \"" + reviewer_email + "\" is an author for Paper" + paper_number) return True tools.assign(client, paper_number, conference.get_id(), reviewer_to_add=reviewer_email) return True
for num, repl_list in replacement_by_number.iteritems(): paper = papers_by_papernum[num] for recommender, new_reviewer in repl_list: anongroups = client.get_groups( 'MIDL.amsterdam/2018/Conference/Paper{}/AnonReviewer.*'.format( num)) revgroup = client.get_group( 'MIDL.amsterdam/2018/Conference/Paper{}/Reviewers'.format(num)) new_reviewer_identities = client.get_groups(member=new_reviewer) if not any([ g.id in a.id for g in new_reviewer_identities for a in anongroups ]): tools.assign(client, num, 'MIDL.amsterdam/2018/Conference', reviewer_to_remove=recommender, reviewer_to_add=new_reviewer) reviewer_response = client.send_mail( reviewer_subject.format(paper.number), [new_reviewer], reviewer_message.format(paper.forum)) recommender_response = client.send_mail( recommender_subject.format(paper.number), [recommender], recommender_message.format(number=paper.number, new_rev=new_reviewer, forum=paper.forum)) print reviewer_response, recommender_response else: print "{} already done: {} --> {}".format(paper.number,