Opened 17 years ago

Last modified 16 years ago

#6990 closed

Omit redundant user.is_authenticated check in django/contrib/admin/templates/admin/base.html — at Version 1

Reported by: Liang Feng <hutuworm@…> 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 (last modified by Ramiro Morales)

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 (1)

comment:1 by Ramiro Morales, 16 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top