Django

Code

Ticket #4447 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

[unicode] Admin crash when draw list of objects if field return None

Reported by: hidded <me@hiddedpp.com> Assigned to: adrian
Milestone: Component: django.contrib.admin
Version: other branch Keywords:
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Subj. Testcase is below.

models.py:
    remote_addr = models.IPAddressField(blank=True, null=True,)
    class Admin:
        list_display = (..., 'remote_addr')

Attachments

admin-list-with-none.diff (0.8 kB) - added by hidded <me@hiddedpp.com> on 06/01/07 00:31:58.

Change History

06/01/07 00:31:58 changed by hidded <me@hiddedpp.com>

  • attachment admin-list-with-none.diff added.

06/01/07 00:46:45 changed by mtredinnick

  • keywords deleted.
  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs changed.

The fix is not really correct, because it's inconsistent handling for that one item when compared to everything else. But the bug report shows that what I wrote in the commit message for [5388] is wrong.

I'll have to think of a fix that works for both cases.

06/01/07 02:30:41 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(In [5400]) unicode: Reverted [5388] and fixed the problem in a different way. Checked every occurrence of smart_unicode() and force_unicode() that was not previously a str() call, so hopefully the problems will not reoccur. Fixed #4447. Refs #4435, #4430.


Add/Change #4447 ([unicode] Admin crash when draw list of objects if field return None)




Change Properties
Action