summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-10-22 10:06:26 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-10-22 10:06:26 +0200
commitd37ea559174bd03455f376734418d2014897aca7 (patch)
treed1c8e7996d849f66cec11e2ab928179ed2718895 /ishtar_common
parentaf236ef5c089350d03dbfe033d4128f81b6bc515 (diff)
downloadIshtar-d37ea559174bd03455f376734418d2014897aca7.tar.bz2
Ishtar-d37ea559174bd03455f376734418d2014897aca7.zip
Image filename are now up to 255 characters. Length test is done on forms. (refs #3325)
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/forms_common.py2
-rw-r--r--ishtar_common/models.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py
index 77e9c8972..c15999721 100644
--- a/ishtar_common/forms_common.py
+++ b/ishtar_common/forms_common.py
@@ -803,7 +803,7 @@ class SourceForm(ManageOldType, forms.Form):
u"(ratio is preserved).</p>") % {
'width': settings.IMAGE_MAX_SIZE[0],
'height': settings.IMAGE_MAX_SIZE[1]}),
- required=False, widget=widgets.ImageFileInput())
+ max_length=255, required=False, widget=widgets.ImageFileInput())
def __init__(self, *args, **kwargs):
super(SourceForm, self).__init__(*args, **kwargs)
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 17df621db..c9be5b086 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -608,9 +608,10 @@ class ItemKey(models.Model):
class ImageModel(models.Model):
- image = models.ImageField(upload_to="upload/", blank=True, null=True)
+ image = models.ImageField(upload_to="upload/", blank=True, null=True,
+ max_length=255)
thumbnail = models.ImageField(upload_to='upload/thumbs/', blank=True,
- null=True)
+ null=True, max_length=255)
IMAGE_MAX_SIZE = settings.IMAGE_MAX_SIZE
THUMB_MAX_SIZE = settings.THUMB_MAX_SIZE
IMAGE_PREFIX = '/'