git: 7fb2e8d7538b - main - deskutils/py-paperless: Update to use Django 4.2

From: Michael Gmelin <grembo_at_FreeBSD.org>
Date: Fri, 23 Feb 2024 16:29:57 UTC
The branch main has been updated by grembo:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7fb2e8d7538b5023b61683288a2872b0df0bd02c

commit 7fb2e8d7538b5023b61683288a2872b0df0bd02c
Author:     Michael Gmelin <grembo@FreeBSD.org>
AuthorDate: 2024-02-22 19:31:23 +0000
Commit:     Michael Gmelin <grembo@FreeBSD.org>
CommitDate: 2024-02-23 16:28:00 +0000

    deskutils/py-paperless: Update to use Django 4.2
---
 deskutils/py-paperless/Makefile                    | 18 ++++----
 .../files/patch-src_documents_admin.py             | 20 +++++++++
 .../patch-src_documents_signals_____init____.py    | 11 +++++
 .../py-paperless/files/patch-src_paperless_urls.py | 50 ++++++++++++++++++++++
 deskutils/py-paperless/pkg-plist                   | 11 ++---
 5 files changed, 95 insertions(+), 15 deletions(-)

diff --git a/deskutils/py-paperless/Makefile b/deskutils/py-paperless/Makefile
index dbd12235d013..f74e3b6db66f 100644
--- a/deskutils/py-paperless/Makefile
+++ b/deskutils/py-paperless/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	paperless
 PORTVERSION=	2.7.0
-PORTREVISION=	16
+PORTREVISION=	17
 CATEGORIES=	deskutils python
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 
@@ -16,12 +16,12 @@ LICENSE=	GPLv3
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
 BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}dateparser>=1.1.0:devel/py-dateparser@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}django-cors-headers>=2.4.0:www/py-django-cors-headers@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}django-crispy-forms>=1.7.2:www/py-django-crispy-forms@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}django-extensions>=2.1.6:www/py-django-extensions@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}django-filter>=2.0.0:www/py-django-filter@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}djangoql>=0.17.0:www/py-djangoql@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}djangorestframework>=3.9.0:www/py-djangorestframework@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}dj42-django-cors-headers>=2.4.0:www/py-dj42-django-cors-headers@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}dj42-django-crispy-forms>=1.7.2:www/py-dj42-django-crispy-forms@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}dj42-django-extensions>=2.1.6:www/py-dj42-django-extensions@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}dj42-django-filter>=2.0.0:www/py-dj42-django-filter@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}dj42-djangoql>=0.17.0:www/py-dj42-djangoql@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}dj42-djangorestframework>=3.9.0:www/py-dj42-djangorestframework@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}fuzzywuzzy>=0.15.1:devel/py-fuzzywuzzy@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}langdetect>=1.0.9:textproc/py-langdetect@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}pdftotext>=2.1.1:textproc/py-pdftotext@${PY_FLAVOR} \
@@ -43,6 +43,8 @@ USE_RC_SUBR=	paperless-consumer
 
 SHEBANG_FILES=	${WRKSRC}/src/manage.py
 
+CONFLICTS_INSTALL=	${PYTHON_PKGNAMEPREFIX}*paperless-ngx
+
 SUB_FILES=	README nginx.conf paperless.7 pkg-message sshd_config uwsgi.ini
 SUB_LIST=	PKGBASE=${PKGBASE} PYTHON_CMD=${PYTHON_CMD} \
 		PYTHONPREFIX_SITELIBDIR=${PYTHONPREFIX_SITELIBDIR} \
@@ -57,7 +59,7 @@ GROUPS=		paperless
 OPTIONS_DEFINE=		DOCS EXAMPLES
 OPTIONS_SINGLE=		IMAGICK
 OPTIONS_SINGLE_IMAGICK=	IMAGICK6_NOX11 IMAGICK6_X11 IMAGICK7_NOX11 IMAGICK7_X11
-OPTIONS_DEFAULT=	IMAGICK6_X11
+OPTIONS_DEFAULT=	IMAGICK7_X11
 
 IMAGICK_DESC=		${IMAGEMAGICK_DESC}
 IMAGICK6_NOX11_DESC=	ImageMagick6 without X11 support
diff --git a/deskutils/py-paperless/files/patch-src_documents_admin.py b/deskutils/py-paperless/files/patch-src_documents_admin.py
new file mode 100644
index 000000000000..c197c210219f
--- /dev/null
+++ b/deskutils/py-paperless/files/patch-src_documents_admin.py
@@ -0,0 +1,20 @@
+--- src/documents/admin.py.orig	2019-01-27 13:48:05 UTC
++++ src/documents/admin.py
+@@ -9,7 +9,7 @@ from django.http import HttpResponseRedirect
+ from django.templatetags.static import static
+ from django.urls import reverse
+ from django.utils.html import format_html, format_html_join
+-from django.utils.http import urlquote
++from urllib.parse import quote
+ from django.utils.safestring import mark_safe
+ from djangoql.admin import DjangoQLSearchMixin
+ 
+@@ -252,7 +254,7 @@ class DocumentAdmin(DjangoQLSearchMixin, CommonAdmin):
+             "name": opts.verbose_name,
+             "obj": format_html(
+                 '<a href="{}">{}</a>',
+-                urlquote(request.path),
++                quote(request.path),
+                 obj
+             ),
+         }
diff --git a/deskutils/py-paperless/files/patch-src_documents_signals_____init____.py b/deskutils/py-paperless/files/patch-src_documents_signals_____init____.py
new file mode 100644
index 000000000000..83e176d8e93f
--- /dev/null
+++ b/deskutils/py-paperless/files/patch-src_documents_signals_____init____.py
@@ -0,0 +1,11 @@
+--- src/documents/signals/__init__.py.orig	2024-02-22 18:57:58 UTC
++++ src/documents/signals/__init__.py
+@@ -1,5 +1,5 @@
+ from django.dispatch import Signal
+ 
+-document_consumption_started = Signal(providing_args=["filename"])
+-document_consumption_finished = Signal(providing_args=["document"])
+-document_consumer_declaration = Signal(providing_args=[])
++document_consumption_started = Signal()
++document_consumption_finished = Signal()
++document_consumer_declaration = Signal()
diff --git a/deskutils/py-paperless/files/patch-src_paperless_urls.py b/deskutils/py-paperless/files/patch-src_paperless_urls.py
new file mode 100644
index 000000000000..d1d2d6e63c25
--- /dev/null
+++ b/deskutils/py-paperless/files/patch-src_paperless_urls.py
@@ -0,0 +1,50 @@
+--- src/paperless/urls.py.orig	2024-02-22 19:09:18 UTC
++++ src/paperless/urls.py
+@@ -1,5 +2,6 @@
+ from django.conf import settings
+-from django.conf.urls import include, static, url
++from django.conf.urls import include, static
++from django.urls import re_path
+ from django.contrib import admin
+ from django.urls import reverse_lazy
+ from django.views.decorators.csrf import csrf_exempt
+@@ -27,32 +27,32 @@ router.register(r"tags", TagViewSet)
+ urlpatterns = [
+ 
+     # API
+-    url(
++    re_path(
+         r"^api/auth/",
+         include(
+             ('rest_framework.urls', 'rest_framework'),
+             namespace="rest_framework")
+     ),
+-    url(r"^api/", include((router.urls, 'drf'), namespace="drf")),
++    re_path(r"^api/", include((router.urls, 'drf'), namespace="drf")),
+ 
+     # File downloads
+-    url(
++    re_path(
+         r"^fetch/(?P<kind>doc|thumb)/(?P<pk>\d+)$",
+         FetchView.as_view(),
+         name="fetch"
+     ),
+ 
+     # File uploads
+-    url(r"^push$", csrf_exempt(PushView.as_view()), name="push"),
++    re_path(r"^push$", csrf_exempt(PushView.as_view()), name="push"),
+ 
+     # Favicon
+-    url(r"^favicon.ico$", FaviconView.as_view(), name="favicon"),
++    re_path(r"^favicon.ico$", FaviconView.as_view(), name="favicon"),
+ 
+     # The Django admin
+-    url(r"admin/", admin.site.urls),
++    re_path(r"admin/", admin.site.urls),
+ 
+     # Redirect / to /admin
+-    url(r"^$", RedirectView.as_view(
++    re_path(r"^$", RedirectView.as_view(
+         permanent=True, url=reverse_lazy("admin:index"))),
+ 
+ ] + static.static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
diff --git a/deskutils/py-paperless/pkg-plist b/deskutils/py-paperless/pkg-plist
index 6737bbc35151..02a7669d0e3e 100644
--- a/deskutils/py-paperless/pkg-plist
+++ b/deskutils/py-paperless/pkg-plist
@@ -326,11 +326,11 @@ bin/paperless
 %%PYTHON_SITELIBDIR%%/paperless/reminders/views.py
 %%PYTHON_SITELIBDIR%%/paperless/setup.cfg
 %%PYTHON_SITELIBDIR%%/paperless/tox.ini
-share/man/man7/paperless.7.gz
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/README
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/nginx.conf
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/sshd_config
 %%PORTEXAMPLES%%%%EXAMPLESDIR%%/uwsgi.ini
+share/man/man7/paperless.7.gz
 %%DATADIR%%/logo/print/eps/Black logo - no background.eps
 %%DATADIR%%/logo/print/eps/Color logo - no background.eps
 %%DATADIR%%/logo/print/eps/Color logo with background.eps
@@ -351,8 +351,8 @@ share/man/man7/paperless.7.gz
 %%WWWDIR%%/static/admin/css/autocomplete.css
 %%WWWDIR%%/static/admin/css/base.css
 %%WWWDIR%%/static/admin/css/changelists.css
+%%WWWDIR%%/static/admin/css/dark_mode.css
 %%WWWDIR%%/static/admin/css/dashboard.css
-%%WWWDIR%%/static/admin/css/fonts.css
 %%WWWDIR%%/static/admin/css/forms.css
 %%WWWDIR%%/static/admin/css/login.css
 %%WWWDIR%%/static/admin/css/nav_sidebar.css
@@ -363,11 +363,6 @@ share/man/man7/paperless.7.gz
 %%WWWDIR%%/static/admin/css/vendor/select2/select2.css
 %%WWWDIR%%/static/admin/css/vendor/select2/select2.min.css
 %%WWWDIR%%/static/admin/css/widgets.css
-%%WWWDIR%%/static/admin/fonts/LICENSE.txt
-%%WWWDIR%%/static/admin/fonts/README.txt
-%%WWWDIR%%/static/admin/fonts/Roboto-Bold-webfont.woff
-%%WWWDIR%%/static/admin/fonts/Roboto-Light-webfont.woff
-%%WWWDIR%%/static/admin/fonts/Roboto-Regular-webfont.woff
 %%WWWDIR%%/static/admin/img/LICENSE
 %%WWWDIR%%/static/admin/img/README.txt
 %%WWWDIR%%/static/admin/img/calendar-icons.svg
@@ -401,12 +396,14 @@ share/man/man7/paperless.7.gz
 %%WWWDIR%%/static/admin/js/change_form.js
 %%WWWDIR%%/static/admin/js/collapse.js
 %%WWWDIR%%/static/admin/js/core.js
+%%WWWDIR%%/static/admin/js/filters.js
 %%WWWDIR%%/static/admin/js/inlines.js
 %%WWWDIR%%/static/admin/js/jquery.init.js
 %%WWWDIR%%/static/admin/js/nav_sidebar.js
 %%WWWDIR%%/static/admin/js/popup_response.js
 %%WWWDIR%%/static/admin/js/prepopulate.js
 %%WWWDIR%%/static/admin/js/prepopulate_init.js
+%%WWWDIR%%/static/admin/js/theme.js
 %%WWWDIR%%/static/admin/js/urlify.js
 %%WWWDIR%%/static/admin/js/vendor/jquery/LICENSE.txt
 %%WWWDIR%%/static/admin/js/vendor/jquery/jquery.js