#5622: Empty ipaddress raises an error (invalid input syntax for type inet: "")
-----------------------------+-----------------------------------------
     Reporter:  anonymous    |                    Owner:  aashu_dwivedi
         Type:  Bug          |                   Status:  assigned
    Component:  Forms        |                  Version:  master
     Severity:  Normal       |               Resolution:
     Keywords:  sprintdec01  |             Triage Stage:  Accepted
    Has patch:  1            |      Needs documentation:  0
  Needs tests:  0            |  Patch needs improvement:  1
Easy pickings:  0            |                    UI/UX:  0
-----------------------------+-----------------------------------------

Comment (by antonagestam):

 Replying to [comment:54 kace]:
 > For users facing this irritating issue, there is a quick, effective
 work-around (based on one of toke's patches (thank you)).  Put this into
 "models.py":
 > {{{
 > class IPAddressFieldNullable(models.IPAddressField) :
 >     def get_db_prep_save(self, value):
 >         return value or None
 > }}}
 > Then change your IP attribute to use this modified field.  E.g.:
 > {{{
 > -   someip = models.IPAddressField(blank=True, null=True )
 > +   someip = IPAddressFieldNullable(blank=True, null=True )
 > }}}

 Thanks for quick fix, confirmed working. Will this ever be fixed?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/5622#comment:57>
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].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to