Opened 10 years ago

Closed 10 years ago

#7259 closed (wontfix)

Better control flow for change made in 7536

Reported by: leotr Owned by: leotr
Component: contrib.admin Version: master
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


It's better to make all by standard methods than dealing with list(queryset)[0] and len(list(queryset)).
All we want to do is to get ONE user or report error if user count is not 1. So the get() method
and exceptions is the best i think.

Attachments (1)

1.diff (1.3 KB) - added by leotr 10 years ago.

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by leotr

Attachment: 1.diff added

comment:1 Changed 10 years ago by leotr

Component: UncategorizedAdmin interface
Triage Stage: UnreviewedDesign decision needed

comment:2 Changed 10 years ago by Valera Grishin


I've opened #7263 that proposes to close potential security risks posed by the same piece of code. It completely removes the lines under discussion.
Good point on standard methods thought, leotr.

comment:3 Changed 10 years ago by Russell Keith-Magee

Resolution: wontfix
Status: newclosed

Closing this ticket in favour of #7263, which is a better approach to solving this problem.

Note: See TracTickets for help on using tickets.
Back to Top