Opened 18 years ago
Closed 17 years ago
#3511 closed (fixed)
use a MultipleObjectsReturned exception instead of assert statement in QuerySet.get()
Reported by: | Owned by: | ||
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | sprintsept14 sprintdec01 | |
Cc: | cheeming@…, bjorn@… | 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
Attachments (2)
Change History (12)
by , 18 years ago
comment:1 by , 18 years ago
Has patch: | set |
---|---|
Needs documentation: | set |
Needs tests: | set |
Triage Stage: | Unreviewed → Design decision needed |
comment:2 by , 17 years ago
Keywords: | sprintsept14 added |
---|---|
Triage Stage: | Design decision needed → Accepted |
comment:3 by , 17 years ago
Owner: | changed from | to
---|
comment:4 by , 17 years ago
Status: | new → assigned |
---|
by , 17 years ago
Attachment: | 3511.2.diff added |
---|
Base of trunk r6781, fixed test and updated documentation
comment:5 by , 17 years ago
Cc: | added |
---|---|
Keywords: | sprintdec01 added |
comment:6 by , 17 years ago
Needs documentation: | unset |
---|---|
Needs tests: | unset |
Owner: | removed |
Status: | assigned → new |
Triage Stage: | Accepted → Ready for checkin |
comment:7 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:8 by , 17 years ago
Thanks to Bjorn as well, we were pairing this during the Dec 2007 sprint
comment:9 by , 17 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Shouldn't that exception inherit from AssertionError for backwards compatibility?
comment:10 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
No, it shouldn't. It's not an assertion error (assertion errors are things that should never, ever happen and, if they do, it's a programmer error). You can have missing database objects in the normal course of events.
Note:
See TracTickets
for help on using tickets.
I'd be +1 on this;
AssertionError
is not the right exception for this situation. Bumping to accepted.