Opened 18 years ago
Closed 17 years ago
#6990 closed (duplicate)
Omit redundant user.is_authenticated check in django/contrib/admin/templates/admin/base.html
| Reported by: | Owned by: | Alexander Koshelev | |
|---|---|---|---|
| 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 (last modified by )
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
Change History (5)
comment:1 by , 17 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 17 years ago
| Keywords: | nfa-someday added; omit redundant user.is_authenticated check removed |
|---|---|
| Triage Stage: | Unreviewed → Design decision needed |
| Version: | SVN → newforms-admin |
comment:3 by , 17 years ago
| Owner: | changed from to |
|---|
Note:
See TracTickets
for help on using tickets.
The check wasn't redundant before the fix for #3032 went in.
Code is still there in newforms-admin so changing to that release and design decision needed for someone to decide whether it is worth removing the now-redundant check.