#13327: FileField/ImageField accessor methods throw unnecessary exceptions when
they are blank or null.
-------------------------------------+-------------------------------------
     Reporter:  kevin.howerton@…     |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Database layer       |                  Version:  1.1
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by mehdyhaghy):

 any workaround to handle this error?

 I get this error in DRF model serializer so I can't suppress it when a
 FileField is Null in database.
 considering the model definition null values should not cause exception
 but it does
 {{{
    class Repository(models.Model):
      owner = models.ForeignKey('auth.User', related_name='file_owner')
      file_content= models.FileField(upload_to='repository',null=True,
 blank=True)
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/13327#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/082.bb04e9753b503d1b180318d89e73e03d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to