Opened 10 years ago

Closed 8 years ago

#871 closed defect (worksforme)

ImageField doesn''t honor blank=True argument

Reported by: flavio.curella@… Owned by: adrian
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 9 years ago by Seer

  • Summary changed from ImageField doesn't honor blank=True argument to ImageField doesn''t honor blank=True argument

Hi all
im fine, gl all!

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

  • Resolution set to worksforme
  • Status changed from new to closed

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 8 years ago by anonymous

  • Resolution worksforme deleted
  • Status changed from closed to reopened

doesnt work for me. :-(

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

returns:

Enter a valid filename.

comment:4 Changed 8 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 8 years ago by SmileyChris

  • Resolution set to worksforme
  • Status changed from reopened to closed

Closing based on John's "worksforme"

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