Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deskutils/py-paperless: Update to use Django 4.2
- Loading branch information
Showing
5 changed files
with
95 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
), | ||
} |
11 changes: 11 additions & 0 deletions
11
deskutils/py-paperless/files/patch-src_documents_signals_____init____.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters