#31472: UserAdmin returns incorrect fieldsets when model has overridden 
__bool__.
-------------------------------------+-------------------------------------
     Reporter:  krnr                 |                    Owner:  krnr
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  contrib.auth         |                  Version:  master
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:  UserAdmin,           |             Triage Stage:
  add_fieldsets, get_fieldsets       |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by felixxm):

 * status:  assigned => closed
 * resolution:   => wontfix


Comment:

 I know that this fix is quite small but you will find other places where
 we use `if instance/obj` pattern, e.g. in `SingleObjectMixin`. Defining
 `__bool__` on a model instance is an edge case and your issue can be
 worked around by defining and using e.g. `is_active(self): return not
 self.is_deleted`. See also
 [https://code.djangoproject.com/ticket/29893#comment:4 arguments] for
 closing a similar ticket.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31472#comment:3>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.8f5d70678390aeb006471b10a5c22fbf%40djangoproject.com.

Reply via email to