Opened 11 years ago

Closed 9 years ago

#871 closed defect (worksforme)

ImageField doesn''t honor blank=True argument

Reported by: flavio.curella@… Owned by: Adrian Holovaty
Component: contrib.admin Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

with this code:

class File(meta.Model):
        file = meta.FileField(upload_to=MEDIA_ROOT, core=True)
        thumbnail = meta.ImageField(upload_to="/files/thumbs/", null=True, blank=True)

adding a File requires also a thumbnail.

Change History (5)

comment:1 Changed 10 years ago by Seer

Summary: ImageField doesn't honor blank=True argumentImageField doesn''t honor blank=True argument

Hi all
im fine, gl all!

comment:2 Changed 10 years ago by Simon G. <dev@…>

Resolution: worksforme
Status: newclosed

Marking as worksforme as I'm unable to replicate this. If you (or anyone else) is still having problems with this, please reopen the ticket and let us know.

comment:3 Changed 9 years ago by anonymous

Resolution: worksforme
Status: closedreopened

doesnt work for me. :-(

picture = models.ImageField(upload_to=settings.UPLOAD_TO, blank=True, null=True)

returns:

Enter a valid filename.

comment:4 Changed 9 years ago by John Shaffer <jshaffer2112@…>

These models all work perfectly for me with [5722]. I couldn't find any circumstances where they would require the ImageField to be non-blank.

class Picture(models.Model):
    title = models.CharField(maxlength=40)
    image = models.ImageField(upload_to='images/', null=True, blank=True)

class PictureB(models.Model):
    image = models.ImageField(upload_to='images/', null=True, blank=True)

class FileWithPicture(models.Model):
    file = models.FileField(upload_to='files/')
    image = models.ImageField(upload_to='images/', null=True, blank=True)

class ImageFK(models.Model):
    fk = models.ForeignKey(FileWithPicture, edit_inline=models.STACKED)
    title = models.CharField(maxlength=40, core=True)
    file = models.FileField(upload_to='files/')
    image = models.ImageField(upload_to='images/', null=True, blank=True)

comment:5 Changed 9 years ago by Chris Beaven

Resolution: worksforme
Status: reopenedclosed

Closing based on John's "worksforme"

Note: See TracTickets for help on using tickets.
Back to Top