Exemplo n.º 1
0
 def get_reviewers(self, settitle=True):
     project = self.get_project()
     experts = project_db_handle.GetBindedReviewers(project,
                                                    need_reviewer_info=True)
     if settitle:
         self.set_page_title(project)
     #if not project.state in ['start_review', 'finished']:
     #    return experts
     #for expert in experts:
     #    expert.review_state = \
     #        project_db_handle.GetReviewerReviewState(project, expert.id)
     return experts
Exemplo n.º 2
0
 def action(self, request, projectid):
     experts = project_db_handle.GetBindedReviewers(
         projectid, need_reviewer_info=False)
     project_dict = project_db_handle.GetProjectInstanceById(
         projectid, returnDict=True)
     for expert in experts:
         expert_db_handle.notify_expert(
             expert,
             sendmessages.TEMPLATE_NOTIFY_REVIEW_PROJECT,
             project_info=project_dict)
     project_db_handle.NotifiedReviewers(projectid, experts)
     return True
Exemplo n.º 3
0
 def get_initial(self):
     initial = expert_db_handle.get_initial_user_data(self.request.GET,
                                                      default=True)
     projectid = self.kwargs['projectid']
     project = project_db_handle.GetProjectInstanceById(projectid)
     experts = project_db_handle.GetBindedReviewers(
         project, need_reviewer_info=False)
     initial['id'] = projectid
     chouqurenshu = (project.chouqurenshu - len(experts))
     if chouqurenshu < 1:
         chouqurenshu = 1
     initial['chouqurenshu'] = chouqurenshu
     return initial
Exemplo n.º 4
0
 def get_initial(self):
     initial = super(RandomBindView, self).get_initial()
     projectid = self.kwargs['projectid']
     project = project_db_handle.GetProjectInstanceById(projectid)
     experts = project_db_handle.GetBindedReviewers(
         project, need_reviewer_info=False)
     initial['id'] = project.id
     initial['projectname'] = project.projectname
     self.modal_header = self._modal_header % project.projectname
     chouqurenshu = (project.chouqurenshu - len(experts))
     if chouqurenshu < 1:
         chouqurenshu = 1
     initial['chouqurenshu'] = chouqurenshu
     return initial
Exemplo n.º 5
0
def get_reviewers(project):
    return len(
        project_db_handle.GetBindedReviewers(project,
                                             need_reviewer_info=False))