drop photologue patch, in repo no, add loader patch
This commit is contained in:
parent
547a41f33b
commit
61a78b52d0
2 changed files with 18 additions and 30 deletions
18
patches/fix_upath_loader.patch
Normal file
18
patches/fix_upath_loader.patch
Normal file
|
@ -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
|
|
@ -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)
|
|
Loading…
Add table
Reference in a new issue