--
Ticket URL: <https://code.djangoproject.com/ticket/16383>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: maraujop (added)
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/16383#comment:1>
* needs_tests: 0 => 1
* stage: Unreviewed => Accepted
Comment:
Overall, I like the idea of raising more specific errors.
See also #6907 and #11421.
It would be useful to discuss the details on django-developers.
--
Ticket URL: <https://code.djangoproject.com/ticket/16383#comment:2>
Comment (by CollinAnderson):
I ran into this one today. The patch would fix it for me. I was trying to
do {{ form.errors }} (errors is a @property), and my validation code
caused an AttributeError. I didn't need to call form.is_valid() in the
view.
So, actually, if we know for sure that the object in the context (current)
does indeed have that attribute (bit), then we should really just re-raise
the original exception.
--
Ticket URL: <https://code.djangoproject.com/ticket/16383#comment:3>
* status: new => assigned
* owner: maraujop => anubhav9042
Comment:
I will work on this in my GSoC project.
--
Ticket URL: <https://code.djangoproject.com/ticket/16383#comment:4>
* version: 1.3 => master
--
Ticket URL: <https://code.djangoproject.com/ticket/16383#comment:5>
* cc: timo (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/16383#comment:6>
* needs_tests: 1 => 0
Comment:
https://github.com/django/django/pull/2979
--
Ticket URL: <https://code.djangoproject.com/ticket/16383#comment:7>
* cc: hirokiky@… (added)
Comment:
this pull-request is focus when some property raise `AttributeError`,
right?
I just commented about problem on the surface.
--
Ticket URL: <https://code.djangoproject.com/ticket/16383#comment:8>
Comment (by anubhav9042):
Yep.
If a property raises AttributeError, so it occured as if property didn't
existed...so I checked that.
--
Ticket URL: <https://code.djangoproject.com/ticket/16383#comment:9>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"0dd05c9e66ebb5cb97136f84373f43582783e1a6"]:
{{{
#!CommitTicketReference repository=""
revision="0dd05c9e66ebb5cb97136f84373f43582783e1a6"
Fixed #16383 -- Raised the AttributeError raised in property of an object
when used in a template.
Thanks maraujop for the report and Hiroki and Tim Graham for review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/16383#comment:10>