I can't see any docs or comments as to a historic (or current) reason it
may be catching the generic version (perhaps there are scenarios where the
Model's `DoesNotExist` is not available yet?), and there are probably no
implications by casting a wider net than necessary, but I'm opening the
ticket anyway in case as a possible cleanup worth doing.
--
Ticket URL: <https://code.djangoproject.com/ticket/21619>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
I don't see any reason why we would need the less specific exception.
--
Ticket URL: <https://code.djangoproject.com/ticket/21619#comment:1>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/21619#comment:2>
* owner: nobody => pjrharley
* cc: pjrharley (added)
* has_patch: 0 => 1
* status: new => assigned
Comment:
Submitted PR here:
https://github.com/django/django/pull/2077
--
Ticket URL: <https://code.djangoproject.com/ticket/21619#comment:3>
* needs_better_patch: 0 => 1
Comment:
Hi,
I added some comments on the PR.
Once those are addressed, you can remove the `patch needs improvement`
flag on the ticket.
Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/21619#comment:4>
* needs_better_patch: 1 => 0
Comment:
Thanks, new commit added to the PR and some comments over there.
--
Ticket URL: <https://code.djangoproject.com/ticket/21619#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"cdd6617da679e19059907979b03c4ef7b15691e6"]:
{{{
#!CommitTicketReference repository=""
revision="cdd6617da679e19059907979b03c4ef7b15691e6"
Fixed #21619 -- Made SingleObjectMixin.get_object catch a more precise
exception.
Thanks to Keryn Knight for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21619#comment:6>