From efb4b532dccc49968d00d0652203c6efda7cd0e7 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 21 2017 09:50:11 +0000 Subject: Backport the equalto test to ensure it works on old jinja2 version The equalto test was added in jinja2 version 2.8: http://jinja.pocoo.org/docs/2.9/templates/#equalto So to get it working on older version, we need this line added. This fixes accessing an user's PR page such as: https://pagure.io/user/pingou/requests --- diff --git a/pagure/__init__.py b/pagure/__init__.py index 2f7ccdb..98277e5 100644 --- a/pagure/__init__.py +++ b/pagure/__init__.py @@ -204,6 +204,9 @@ pagure.lib.set_log(LOG) APP.wsgi_app = pagure.proxy.ReverseProxied(APP.wsgi_app) +# Back port 'equalto' to older version of jinja2 +APP.jinja_env.tests.setdefault('equalto', lambda value, other: value == other) + def authenticated(): ''' Utility function checking if the current user is logged in or not.