1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

deskutils/py-paperless: Update to use Django 4.2

This commit is contained in:
Michael Gmelin 2024-02-22 20:31:23 +01:00
parent d1edb79175
commit 7fb2e8d753
5 changed files with 95 additions and 15 deletions

View File

@ -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

View File

@ -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
),
}

View File

@ -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()

View File

@ -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)

View File

@ -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