#28089: Remove requirement of get_short_name() and get_full_name() for 
subclasses
of AbstractBaseUser
--------------------------------------+------------------------------------
     Reporter:  Josh Schneier         |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  contrib.auth          |                  Version:  master
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by Tim Graham):

 * stage:  Unreviewed => Accepted


Comment:

 Removing the definitions in `AbstractBaseUser` that raise
 `NotImplementedError` might be reasonable. As far as I see, the admin
 would work without them:

 `{% firstof user.get_short_name user.get_username %}`
 (from `contrib/admin/templates/admin/base.html`)

 `<td>{{ action.user.get_username }}{% if action.user.get_full_name %} ({{
 action.user.get_full_name }}){% endif %}</td>`
 (from `contrib/admin/templates/admin/object_history.html`)

 Currently, if a subclass doesn't want to use those methods, it has to
 define them to return an empty value to suppress the `NotImplementedError`
 exceptions while rendering those admin templates.

 Documentation updates as well as a mention in the release notes for third-
 party apps that might expect those methods to exist are also required.

--
Ticket URL: <https://code.djangoproject.com/ticket/28089#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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.db48c56e25bf682fad1b79bca616eee5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to