def send_message_to_reviewers(request):
    html_template_ref = 'assistant_reviewers_startup_html'
    txt_template_ref = 'assistant_reviewers_startup_txt'
    reviewers = reviewer.find_reviewers()
    for rev in reviewers:
        print(rev.person)
        send_message(rev.person, html_template_ref, txt_template_ref)
    save_message_history(request, message_type.TO_ALL_REVIEWERS)
    return redirect('messages_history')
Exemplo n.º 2
0
def send_message_to_reviewers(request):
    html_template_ref = 'assistant_reviewers_startup_html'
    txt_template_ref = 'assistant_reviewers_startup_txt'
    reviewers = reviewer.find_reviewers()
    for rev in reviewers:
        send_message(rev.person, html_template_ref, txt_template_ref, role=rev.role,
                     entity=entity_version.get_last_version(rev.entity).acronym)
    save_message_history(request, message_type.TO_ALL_REVIEWERS)
    return redirect('messages_history')
Exemplo n.º 3
0
def send_message_to_reviewers(request):
    html_template_ref = 'assistant_reviewers_startup_html'
    txt_template_ref = 'assistant_reviewers_startup_txt'
    reviewers = reviewer.find_reviewers()
    for rev in reviewers:
        send_message(rev.person,
                     html_template_ref,
                     txt_template_ref,
                     role=rev.role,
                     entity=entity_version.get_last_version(
                         rev.entity).acronym)
    save_message_history(request, message_type.TO_ALL_REVIEWERS)
    return redirect('messages_history')
def reviewers_index(request):
    all_reviewers = reviewer.find_reviewers()
    initial_formset_content = [{'action': None,
                                'entity': rev.entity,
                                'entity_version': entity_version.get_last_version(rev.entity),
                                'role': rev.role,
                                'person': rev.person,
                                'id': rev.id,
                                } for rev in all_reviewers]
    reviewers_formset = formset_factory(ReviewersFormset, extra=0)(initial=initial_formset_content)
    for form in reviewers_formset:
        current_reviewer = reviewer.find_by_id(form['id'].value())
        if review.find_by_reviewer(current_reviewer).count() == 0:
            form.fields['action'].choices = (('-----', _('-----')), ('DELETE', _('delete')),
                                             ('REPLACE', _('replace')))
        else:
            form.fields['action'].choices = (('-----', _('-----')), ('REPLACE', _('replace')))
    return render(request, "reviewers_list.html", {'reviewers_formset': reviewers_formset
                                                   })
Exemplo n.º 5
0
def reviewers_index(request):
    all_reviewers = reviewer.find_reviewers()
    initial_formset_content = [{'action': None,
                                'entity': rev.entity,
                                'entity_version': entity_version.get_last_version(rev.entity),
                                'role': rev.role,
                                'person': rev.person,
                                'id': rev.id,
                                } for rev in all_reviewers]
    reviewers_formset = formset_factory(ReviewersFormset, extra=0)(initial=initial_formset_content)
    for form in reviewers_formset:
        current_reviewer = reviewer.find_by_id(form['id'].value())
        if review.find_by_reviewer(current_reviewer).count() == 0:
            form.fields['action'].choices = (('-----', _('-----')), ('DELETE', _('delete')),
                                             ('REPLACE', _('replace')))
        else:
            form.fields['action'].choices = (('-----', _('-----')), ('REPLACE', _('replace')))
    return render(request, "reviewers_list.html", {'reviewers_formset': reviewers_formset
                                                   })
Exemplo n.º 6
0
 def test_find_reviewers(self):
     self.assertCountEqual(
         list(reviewer.find_reviewers()),
         [self.reviewer2, self.reviewer1, self.reviewer3, self.reviewer4, self.reviewer5]
     )
Exemplo n.º 7
0
 def test_find_reviewers(self):
     self.assertCountEqual(
         [rev for rev in reviewer.find_reviewers()],
         [self.reviewer2, self.reviewer1, self.reviewer3]
     )
 def get_queryset(self):
     queryset = reviewer.find_reviewers()
     return queryset
Exemplo n.º 9
0
 def test_find_reviewers(self):
     self.assertCountEqual(list(reviewer.find_reviewers()), [
         self.reviewer2, self.reviewer1, self.reviewer3, self.reviewer4,
         self.reviewer5
     ])
Exemplo n.º 10
0
 def get_queryset(self):
     queryset = reviewer.find_reviewers()
     return queryset