Opened 17 years ago

Closed 16 years ago

#7259 closed (wontfix)

Better control flow for change made in 7536

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

Description

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 17 years ago.

Download all attachments as: .zip

Change History (4)

by leotr, 17 years ago

Attachment: 1.diff added

comment:1 by leotr, 17 years ago

Component: UncategorizedAdmin interface
Triage Stage: UnreviewedDesign decision needed

comment:2 by Valera Grishin, 17 years ago

Hi

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 by Russell Keith-Magee, 16 years ago

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