]> git.parisson.com Git - teleforma.git/commitdiff
Reinstall a pagination modules and add a patch to force postman to use it.
authortest test <yoanl@pilotsystems.net>
Tue, 1 Jun 2021 09:01:22 +0000 (11:01 +0200)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 12 Apr 2023 09:43:56 +0000 (11:43 +0200)
app/settings.py
requirements.txt
teleforma/__init__.py
teleforma/patches.py [new file with mode: 0644]

index 20ae3e242b126e88484c654598da0d7ce0fefc9d..7df126751525f26b1745974ffe5491b51faee1c2 100644 (file)
@@ -121,8 +121,7 @@ MIDDLEWARE = (('debug_toolbar.middleware.DebugToolbarMiddleware',) if DEBUG_TOOL
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
     'django.middleware.locale.LocaleMiddleware',
-    # TODO : check if useless
-    # 'pagination.middleware.PaginationMiddleware',
+    'dj_pagination.middleware.PaginationMiddleware',
     'teleforma.middleware.XsSharing',
     'django_user_agents.middleware.UserAgentMiddleware',
 )
@@ -142,7 +141,7 @@ INSTALLED_APPS = (
     'teleforma',
     'sorl.thumbnail',
     # 'django_extensions',
-    # 'pagination',
+    'dj_pagination',
     'postman',
     # 'timezones',
     # 'googletools',
index bec6974021262009287548f8eb99bbab4da58136..b1365fd583eeec487a3f6f5d2d81e7f33c66ad27 100644 (file)
@@ -4,6 +4,7 @@ Django==3.2.3
 # django-extensions==1.2.1
 # django-timezones==0.2
 # django-registration==3.1.2
+dj_pagination==2.5.0 # used by postman
 django-json-rpc==0.7.1
 # django-google-tools==1.1.0
 django-nvd3==0.8.2
index e2b3b9d6ca476e8ba133419e1d3cf438483db383..c9643f7c983916a15f3b6cd852bcb138d216e663 100644 (file)
@@ -47,3 +47,5 @@ same conditions as regards security.
 The fact that you are presently reading this means that you have had
 knowledge of the CeCILL license and that you accept its terms.
 """
+
+import teleforma.patches
\ No newline at end of file
diff --git a/teleforma/patches.py b/teleforma/patches.py
new file mode 100644 (file)
index 0000000..5340983
--- /dev/null
@@ -0,0 +1,5 @@
+# postman should use dj_pagination when installed but that's not the case here.
+# Instead it uses its dj_pagination mock functions.
+# So here we replace the pagination_tags templatetags of postman by those of dj_pagination.
+import sys
+sys.modules['postman.templatetags.pagination_tags'] = __import__('dj_pagination.templatetags.pagination_tags')