Exemple #1
0
def ongoing_history(request):
    """
    View configuration for the current reviews.

    :param request: current request of the server
    :return: dictionary with title and project name as well as a value, weather the user is logged in
    """
    logger('ongoing_history', 'def {}'.format(request.matchdict))
    ui_locales = get_language_from_cookie(request)
    _tn = Translator(ui_locales)

    history = review_history_helper.get_ongoing_reviews(
        request.application_url, request.validated['user'], _tn)
    prep_dict = __main_dict(request, _tn.get(_.review_ongoing))
    prep_dict.update({'history': history})
    return prep_dict
Exemple #2
0
def ongoing(request):
    """
    View configuration for the current reviews.

    :param request: current request of the server
    :return: dictionary with title and project name as well as a value, weather the user is logged in
    """
    LOG.debug("Current reviews view. %s / %s", request.matchdict,
              request.params)
    ui_locales = get_language_from_cookie(request)
    _tn = Translator(ui_locales)

    specific_history = get_ongoing_reviews(request.application_url,
                                           request.validated['user'], _tn)
    prep_dict = main_dict(request, _tn.get(_.review_ongoing))
    prep_dict.update({'history': specific_history})
    return prep_dict
Exemple #3
0
 def test_get_ongoing_review_for_without_special_access(self):
     ongoing = get_ongoing_reviews('mainpage', self.user_anonymous,
                                   self.translator)
     self.assertIn('has_access', ongoing)
     self.assertIn('past_decision', ongoing)
     self.assertFalse(ongoing['has_access'])
Exemple #4
0
 def test_get_ongoing_review_for_with_special_access(self):
     ongoing = get_ongoing_reviews('mainpage', self.user_tobi,
                                   self.translator)
     self.assertIn('has_access', ongoing)
     self.assertIn('past_decision', ongoing)
     self.assertTrue(ongoing['has_access'])