]> 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>
Tue, 1 Jun 2021 09:01:22 +0000 (11:01 +0200)
app/settings.py
requirements.txt
teleforma/__init__.py
teleforma/patches.py [new file with mode: 0644]

index 5f6517f320db056e3f14dab921ff7a219db25787..c732499304a334bf1e4a087c415ff91c2fca0337 100644 (file)
@@ -127,8 +127,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',
 )
@@ -151,7 +150,7 @@ INSTALLED_APPS = (
     'jsonrpc',
     'sorl.thumbnail',
     # 'django_extensions',
-    # 'pagination',
+    'dj_pagination',
     'postman',
     # 'timezones',
     # 'googletools',
index 56d7f373dc2de2b9d31b1000fcfdbdcf1efc9a0e..0372fcfc9dc98738682685840610b7d4731f1114 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 daf70c4769750fea27051a73b65b9a9816c30dbc..64c4c7d34f33200c7cdff0cc244347ab1209179a 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')