Opened 18 years ago
Last modified 17 years ago
#6990 closed
Omit redundant user.is_authenticated check in django/contrib/admin/templates/admin/base.html — at Initial Version
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | contrib.admin | Version: | newforms-admin |
| Severity: | Keywords: | nfa-someday | |
| Cc: | Triage Stage: | Design decision needed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
In the admin template: django/contrib/admin/templates/admin/base.html: {% if user.is_authenticated and user.is_staff %}
While checking if user is staff, it's No need to check if user is authenticated. Since user who is not authenticated can't pass the "user.is_staff" check, so the "user.is_authenticated" check could be omitted.
p.s. may save some precious cpu cycles on Google App Engine. :P
Note:
See TracTickets
for help on using tickets.