--
Ticket URL: <https://code.djangoproject.com/ticket/28089>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* type: Uncategorized => Cleanup/optimization
Comment:
Do you have any code changes is mind or would this be a documentation
clarification? I'm not sure what "removing the requirement" looks like.
--
Ticket URL: <https://code.djangoproject.com/ticket/28089#comment:1>
Comment (by Josh Schneier):
Currently in `AbstractBaseUser` they raise `NotImplementedError`, I would
remove those definitions.
Actually what do you think of simply removing `get_short_name` and
`get_full_name` altogether? They feel like legacy warts to me given the
custom user model. We can just use the `__str__` of the user where
appropriate (currently `get_username()` everywhere).
--
Ticket URL: <https://code.djangoproject.com/ticket/28089#comment:2>
* 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>
* status: new => assigned
* owner: nobody => Josh Schneier
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/8377 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/28089#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"5df0ff4155d2ee3192768e8f7f75b546f98c3f77" 5df0ff4]:
{{{
#!CommitTicketReference repository=""
revision="5df0ff4155d2ee3192768e8f7f75b546f98c3f77"
Fixed #28089 -- Removed requirement to implement get_short_name() and
get_full_name() in AbstractBaseUser subclasses.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28089#comment:5>