Re: [Django] #8997: Misleading error message when calling get_absolute_url

2012-01-02 Thread Django
#8997: Misleading error message when calling get_absolute_url
-+-
 Reporter:  Rob  |Owner:  julien
   |   Status:  closed
 Type:  Bug  |  Version:  1.2
Component:  Database layer   |   Resolution:  fixed
  (models, ORM)  | Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:   |  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-
Changes (by julien):

 * status:  new => closed
 * owner:   => julien
 * resolution:   => fixed


Comment:

 In [17328]:
 {{{
 #!CommitTicketReference repository="" revision="17328"
 Fixed #8997 -- Prevented the contenttypes `shortcut` view to hide errors
 occurring inside the `get_absolute_url()` method. Thanks to Rob for the
 report and to joshlory, Aymeric Augustin and Claude Paroz for the patch.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #8997: Misleading error message when calling get_absolute_url

2011-12-30 Thread Django
#8997: Misleading error message when calling get_absolute_url
-+-
 Reporter:  Rob  |Owner:
   |   Status:  new
 Type:  Bug  |  Version:  1.2
Component:  Database layer   |   Resolution:
  (models, ORM)  | Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:   |  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-
Changes (by claudep):

 * owner:  joshlory =>
 * status:  assigned => new
 * needs_better_patch:  1 => 0


Comment:

 New patch added, I'd rather not split contenttypes tests (I hate those
 model/regression test splits).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #8997: Misleading error message when calling get_absolute_url

2011-12-12 Thread Django
#8997: Misleading error message when calling get_absolute_url
-+-
 Reporter:  Rob  |Owner:  joshlory
   |   Status:  assigned
 Type:  Bug  |  Version:  1.2
Component:  Database layer   |   Resolution:
  (models, ORM)  | Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:   |  Patch needs improvement:  1
Has patch:  1|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-
Changes (by aaugustin):

 * needs_better_patch:  0 => 1


Comment:

 In this case the second technique looks better to me:
 {{{

 --- django/contrib/contenttypes/views.py(revision 17200)
 +++ django/contrib/contenttypes/views.py(working copy)
 @@ -14,9 +14,10 @@
  except (ObjectDoesNotExist, ValueError):
  raise http.Http404("Content type %s object %s doesn't exist" %
 (content_type_id, object_id))
  try:
 -absurl = obj.get_absolute_url()
 +get_absolute_url = obj.get_absolute_url
  except AttributeError:
 -raise http.Http404("%s objects don't have get_absolute_url()
 methods" % content_type.name)
 +raise http.Http404("%s objects don't have a get_absolute_url()
 method" % content_type.name)
 +absurl = get_absolute_url()

  # Try to figure out the object's domain, so we can do a cross-site
 redirect
  # if necessary.
 }}}

 The tests shouldn't monkey patch `django.contrib.auth.models.Group`; they
 should define a new model with a buggy `get_absolute_url` method.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #8997: Misleading error message when calling get_absolute_url

2011-12-12 Thread Django
#8997: Misleading error message when calling get_absolute_url
-+-
 Reporter:  Rob  |Owner:  joshlory
   |   Status:  assigned
 Type:  Bug  |  Version:  1.2
Component:  Database layer   |   Resolution:
  (models, ORM)  | Triage Stage:  Accepted
 Severity:  Normal   |  Needs documentation:  0
 Keywords:   |  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-
Changes (by aaugustin):

 * ui_ux:   => 0
 * easy:   => 0
 * stage:  Design decision needed => Accepted


Comment:

 Yes, the check for the existence of `get_absolute_url` must be improved:
 - either use `hasattr()`, as in the current patch;
 - or something like this:
 {{{
 try:
 get_absolute_url = obj.get_absolute_url
 except AttributeError:
 # whatever
 else:
 # do something with get_absolute_url
 }}}

 The first approach is shorter and usually more readable.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #8997: Misleading error message when calling get_absolute_url

2010-11-21 Thread Django
#8997: Misleading error message when calling get_absolute_url
-+--
  Reporter:  Rob   | Owner:  
joshlory
Status:  assigned| Milestone:   
   
 Component:  Database layer (models, ORM)|   Version:  1.2  
   
Resolution:  |  Keywords:   
   
 Stage:  Design decision needed  | Has_patch:  1
   
Needs_docs:  0   |   Needs_tests:  0
   
Needs_better_patch:  0   |  
-+--
Changes (by joshlory):

 * cc: lor...@missouri.edu (added)
  * status:  new => assigned

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #8997: Misleading error message when calling get_absolute_url

2010-11-21 Thread Django
#8997: Misleading error message when calling get_absolute_url
-+--
  Reporter:  Rob   | Owner:  
joshlory
Status:  new | Milestone:   
   
 Component:  Database layer (models, ORM)|   Version:  1.2  
   
Resolution:  |  Keywords:   
   
 Stage:  Design decision needed  | Has_patch:  1
   
Needs_docs:  0   |   Needs_tests:  0
   
Needs_better_patch:  0   |  
-+--
Changes (by joshlory):

  * owner:  nobody => joshlory
  * has_patch:  0 => 1

Comment:

 Added a patch with tests -- not sure if I put the tests in the correct
 location.  By not catching the {{{AttributeError}}} in shortcut() the
 error is allowed to propagate normally.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #8997: Misleading error message when calling get_absolute_url

2010-11-20 Thread Django
#8997: Misleading error message when calling get_absolute_url
-+--
  Reporter:  Rob   | Owner:  
nobody
Status:  new | Milestone:   
 
 Component:  Database layer (models, ORM)|   Version:  1.2  
 
Resolution:  |  Keywords:   
 
 Stage:  Design decision needed  | Has_patch:  0
 
Needs_docs:  0   |   Needs_tests:  0
 
Needs_better_patch:  0   |  
-+--
Changes (by joshlory):

  * version:  1.1 => 1.2

Comment:

 The test case proposed by GDorn appears to be fixed: creating a model with
 a get_absolute_url() function containing a divide by zero correctly
 returns a 500 Debug page when DEBUG=True.  However the original bug
 (misleading error with a typo in a field name) is still present in Django
 1.2.3.  How to make this happen:

 Create a model with a get_absolute_url function that references an invalid
 field, e.g.:

 {{{
 def get_absolute_url(self):
 return "/foo/bar/" + self.invalid_field
 }}}

 Hook the model up to the django admin. Create one of these models. Click
 the 'view on site' button.

 '''Expected behavior:''' When DEBUG=True, display a 500 Debug page showing
 an {{{AttributeError}}} in the model.

 '''Actual output:''' Django reports a 404 error: " objects don't have
 get_absolute_url() methods".

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #8997: Misleading error message when calling get_absolute_url

2009-12-16 Thread Django
#8997: Misleading error message when calling get_absolute_url
-+--
  Reporter:  Rob   | Owner:  
nobody
Status:  new | Milestone:   
 
 Component:  Database layer (models, ORM)|   Version:  1.1  
 
Resolution:  |  Keywords:   
 
 Stage:  Design decision needed  | Has_patch:  0
 
Needs_docs:  0   |   Needs_tests:  0
 
Needs_better_patch:  0   |  
-+--
Changes (by GDorn):

  * version:  1.0 => 1.1

Comment:

 How to make this happen:

 Make sure DEBUG=True (otherwise it'll just 404).
 Make a model object with a get_absolute_url() function with an error in
 it.  Try a divide by zero, that's fun.
 Hook the model up to the django admin.
 Create one of these models.
 Click the 'view on site' button.

 This applies to Django 1.1 as well as 1.0, so I'm updating the version.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

--

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.




Re: [Django] #8997: Misleading error message when calling get_absolute_url

2009-05-06 Thread Django
#8997: Misleading error message when calling get_absolute_url
-+--
  Reporter:  Rob   | Owner:  
nobody
Status:  new | Milestone:   
 
 Component:  Database layer (models, ORM)|   Version:  1.0  
 
Resolution:  |  Keywords:   
 
 Stage:  Design decision needed  | Has_patch:  0
 
Needs_docs:  0   |   Needs_tests:  0
 
Needs_better_patch:  0   |  
-+--
Changes (by thejaswi_puthraya):

  * component:  Uncategorized => Database layer (models, ORM)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #8997: Misleading error message when calling get_absolute_url

2009-02-27 Thread Django
#8997: Misleading error message when calling get_absolute_url
-+--
  Reporter:  Rob   | Owner:  
nobody
Status:  new | Milestone:   
 
 Component:  Uncategorized   |   Version:  1.0  
 
Resolution:  |  Keywords:   
 
 Stage:  Design decision needed  | Has_patch:  0
 
Needs_docs:  0   |   Needs_tests:  0
 
Needs_better_patch:  0   |  
-+--
Changes (by jacob):

  * stage:  Unreviewed => Design decision needed

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #8997: Misleading error message when calling get_absolute_url

2009-02-25 Thread Django
#8997: Misleading error message when calling get_absolute_url
-+--
  Reporter:  Rob   | Owner:  
nobody
Status:  new | Milestone:   
 
 Component:  Uncategorized   |   Version:  1.0  
 
Resolution:  |  Keywords:   
 
 Stage:  Unreviewed  | Has_patch:  0
 
Needs_docs:  0   |   Needs_tests:  0
 
Needs_better_patch:  0   |  
-+--
Changes (by jacob):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 We need more details to figure this one out. Where, exactly, are you
 seeing that error message? Is there a traceback? If so, post it. Is this
 only with a specific model or setup, or does this happen elsewhere?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---