Opened 5 years ago

Closed 5 years ago

#14321 closed (duplicate)

IPAddressField inserted as empty string although null=True

Reported by: rihad@… Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I have these fields in a model:

        ipaddr1 = models.IPAddressField()
        ipaddr2 = models.IPAddressField(blank=True, null=True)

When I "wrap" this model in a ModelForm, fill the form, and call, empty ipaddr2 gets inserted as an empty string, causing database
errors for Postgres' inet type.

I believe Django shouldn't be disregarding null=true for an IPAddressField when dealing with Postgres.

Change History (1)

comment:1 Changed 5 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Sorry for the dupe. Same problem as here.

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