Compare commits

..

3 Commits

Author SHA1 Message Date
j
89e0dfc0eb longer teaser 2018-08-21 11:33:33 +02:00
j
f5c500d149 allow zip files with folders 2018-08-21 11:28:28 +02:00
j
449e9e41d1 allow larger uploads 2018-08-21 11:28:16 +02:00
3 changed files with 34 additions and 2 deletions

View File

@ -148,6 +148,8 @@ IMAGE_PREFIX = 'http://studio.camp/images/'
CONTACT_FROM_EMAIL = 'contact@studio.camp' CONTACT_FROM_EMAIL = 'contact@studio.camp'
CONTACT_TO_EMAIL = ['contact@studio.camp'] CONTACT_TO_EMAIL = ['contact@studio.camp']
DATA_UPLOAD_MAX_MEMORY_SIZE = 150 * 1024 * 1024
try: try:
from local_settings import * from local_settings import *
except: except:
@ -169,4 +171,4 @@ except NameError:
secret.write(SECRET_KEY) secret.write(SECRET_KEY)
secret.close() secret.close()
except IOError: except IOError:
Exception('Please create a %s file with random characters to generate your secret key!' % SECRET_FILE) raise Exception('Please create a %s file with random characters to generate your secret key!' % SECRET_FILE)

View File

@ -68,7 +68,7 @@ class Content(models.Model):
title = models.CharField(max_length=255) title = models.CharField(max_length=255)
header = MarkdownxField(blank=True, null=True, default='') header = MarkdownxField(blank=True, null=True, default='')
body = MarkdownxField(blank=True, null=True, default='') body = MarkdownxField(blank=True, null=True, default='')
teaser = models.TextField(blank=True, null=True, validators=[MaxLengthValidator(200)]) teaser = models.TextField(blank=True, null=True, validators=[MaxLengthValidator(250)])
schedule = MarkdownxField(blank=True, null=True, default='') schedule = MarkdownxField(blank=True, null=True, default='')
schedulebutton = models.CharField(db_column='scheduleButton', max_length=255, blank=True, null=True) # Field name made lowercase. schedulebutton = models.CharField(db_column='scheduleButton', max_length=255, blank=True, null=True) # Field name made lowercase.
optbtn2 = models.CharField(db_column='optBtn2', max_length=127, blank=True, null=True) # Field name made lowercase. optbtn2 = models.CharField(db_column='optBtn2', max_length=127, blank=True, null=True) # Field name made lowercase.

View File

@ -0,0 +1,30 @@
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)