upgpkg: ufw 0.36.2-1
[ArchLinux/community.git] / pgadmin4 / repos / community-x86_64 / jinja-3.1.patch
blobb32df69f15f5bbd1439037b72434d286d84ef7b7
1 From 04d0ab4adfe6c8d1eabdcfbdbbc47c5c73ee59fe Mon Sep 17 00:00:00 2001
2 From: Nikhil Mohite <nikhil.mohite@enterprisedb.com>
3 Date: Fri, 25 Mar 2022 11:52:11 +0530
4 Subject: [PATCH] Ensure that pgAdmin4 should work with latest jinja2 version.
5 Fixes #7269
7 ---
8 docs/en_US/release_notes_6_8.rst | 1 +
9 web/pgadmin/__init__.py | 3 ++-
10 2 files changed, 3 insertions(+), 1 deletion(-)
12 diff --git a/web/pgadmin/__init__.py b/web/pgadmin/__init__.py
13 index 19befe9f5d..d5188dd5d6 100644
14 --- a/web/pgadmin/__init__.py
15 +++ b/web/pgadmin/__init__.py
16 @@ -33,6 +33,7 @@
17 from werkzeug.datastructures import ImmutableDict
18 from werkzeug.local import LocalProxy
19 from werkzeug.utils import find_modules
20 +from jinja2 import select_autoescape
22 from pgadmin.model import db, Role, Server, SharedServer, ServerGroup, \
23 User, Keys, Version, SCHEMA_VERSION as CURRENT_SCHEMA_VERSION
24 @@ -70,7 +71,7 @@ class PgAdmin(Flask):
25 def __init__(self, *args, **kwargs):
26 # Set the template loader to a postgres-version-aware loader
27 self.jinja_options = ImmutableDict(
28 - extensions=['jinja2.ext.autoescape', 'jinja2.ext.with_'],
29 + autoescape=select_autoescape(enabled_extensions=('html', 'xml')),
30 loader=VersionedTemplateLoader(self)
32 self.logout_hooks = []