Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#20102 closed Uncategorized (needsinfo)

None no longer matches zero-length string on CharField

Reported by: simon29 Owned by: nobody
Component: Documentation Version: 1.5
Severity: Normal Keywords:
Cc: andrewsg Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

I've just updated from 1.5 stable to latest commit aaec4f2bd8a63b3dceebad7804c5897e7874833d.

Model.objects.filter(mycharfield=None) used to return instances where mycharfield is actually a zero-length string.

Now, it seems I need to explicitly specify Model.objects.filter(mycharfield=).

Minor change, but the implications could be pretty severe for some apps.

Suggest either reverting to previous behaviour or updating the "backwards incompatible changes" list.

Change History (3)

comment:1 Changed 2 years ago by andrewsg

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I looked into this just now, and I was able to verify that filter(mycharfield=None) does not pick up empty strings in 1.6, but when I tested it in 1.5 stable the behavior was the same. Can you offer reproduction steps for the behavior you describe on 1.5?

Version 0, edited 2 years ago by andrewsg (next)

comment:2 Changed 2 years ago by andrewsg

  • Cc andrewsg added

comment:3 Changed 2 years ago by andrewsg

  • Resolution set to needsinfo
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top