From 61a78b52d0f5754f4a3a233f06cd6ec1ab3bc92c Mon Sep 17 00:00:00 2001 From: j Date: Mon, 24 Mar 2025 16:05:51 +0000 Subject: [PATCH] drop photologue patch, in repo no, add loader patch --- patches/fix_upath_loader.patch | 18 ++++++++++++++++ patches/photologue-allow-folders.patch | 30 -------------------------- 2 files changed, 18 insertions(+), 30 deletions(-) create mode 100644 patches/fix_upath_loader.patch delete mode 100644 patches/photologue-allow-folders.patch diff --git a/patches/fix_upath_loader.patch b/patches/fix_upath_loader.patch new file mode 100644 index 0000000..996c459 --- /dev/null +++ b/patches/fix_upath_loader.patch @@ -0,0 +1,18 @@ +--- /home/j/p/camp/camp/.venv/lib/python3.13/site-packages/app_namespace/loader.py.orig 2025-01-30 17:09:14.284447979 +0530 ++++ /home/j/p/camp/camp/.venv/lib/python3.13/site-packages/app_namespace/loader.py 2025-01-30 17:09:22.637303678 +0530 +@@ -6,7 +6,6 @@ + + import django + from django.apps import apps +-from django.utils._os import upath + from django.utils._os import safe_join + try: + from django.template import Origin +@@ -64,7 +63,6 @@ + templates_dir = os.path.join( + getattr(app_config, 'path', '/'), 'templates') + if os.path.isdir(templates_dir): +- templates_dir = upath(templates_dir) + app_templates_dirs[app_config.name] = templates_dir + app_templates_dirs[app_config.label] = templates_dir + return app_templates_dirs diff --git a/patches/photologue-allow-folders.patch b/patches/photologue-allow-folders.patch deleted file mode 100644 index aa34301..0000000 --- a/patches/photologue-allow-folders.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/photologue/forms.py b/photologue/forms.py -index 2b05c17..1a69f88 100644 ---- a/photologue/forms.py -+++ b/photologue/forms.py -@@ -114,16 +114,6 @@ class UploadZipForm(forms.Form): - logger.debug('Ignoring file "{0}".'.format(filename)) - continue - -- if os.path.dirname(filename): -- logger.warning('Ignoring file "{0}" as it is in a subfolder; all images should be in the top ' -- 'folder of the zip.'.format(filename)) -- if request: -- messages.warning(request, -- _('Ignoring file "{filename}" as it is in a subfolder; all images should ' -- 'be in the top folder of the zip.').format(filename=filename), -- fail_silently=True) -- continue -- - data = zip.read(filename) - - if not len(data): -@@ -166,7 +156,7 @@ class UploadZipForm(forms.Form): - continue - - contentfile = ContentFile(data) -- photo.image.save(filename, contentfile) -+ photo.image.save(os.path.basename(filename), contentfile) - photo.save() - photo.sites.add(current_site) - gallery.photos.add(photo)