Opened 17 years ago
Last modified 15 years ago
#6991 closed
Omit redundant "if" judgements — at Version 1
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.admin | Version: | newforms-admin |
Severity: | Keywords: | nfa-someday yandex-sprint ep2008 | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
django/contrib/admin/views/decorators.py: if request.user.is_authenticated() and request.user.is_staff:
### COMMENT: request.user.is_staff is True
implied that request.user.is_authenticated()
is True, so request.user.is_authenticated()
could be omitted.
docs/authentication.txt: if not (request.user.is_authenticated() and request.user.has_perm('polls.can_vote')):
### COMMENT: request.user.has_perm('polls.can_vote') is True
implied that request.user.is_authenticated()
is True, so request.user.is_authenticated()
could be omitted.
p.s. may save some precious cpu cycles on Google App Engine. :P
Note:
See TracTickets
for help on using tickets.