#19362: Recursion error when deleting model object through admin
-------------------------------+-------------------------
     Reporter:  m3wolf         |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  Uncategorized  |    Version:  1.5-alpha-1
     Severity:  Normal         |   Keywords:  python2.7.3
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+-------------------------
 When I try to delete a specific object using the admin interface I get an
 error:
 {{{
 RuntimeError at /admin/gtd/node/1470/delete/
 maximum recursion depth exceeded while calling a Python object
 }}}
 It appears to be trying to convert something to unicode but I don't know
 what. From the Django error message I can see that the object appears as
 {{{<Node: [<span style="color: rgba(230, 138, 0,
 1.0)"><strong>DFRD</strong></span>] Test todo item>}}}, which doesn't seem
 to have any weird characters in it. The title is what I expect to be
 return from `__str__(self)` as described below.

 If I delete a different object (which has similar HTML markup in it) from
 the same model it works with no errors. The model in question defines
 `__str__(self)` which returns the value from a models.TextField()
 attribute wrapped in some HTML (<span style="..."></span>) which is passed
 through mark_safe() before being returned. The model is decorated with
 `@python_2_unicode_compatible`. Following the python3 migration guide, I
 added `from __future__ import unicode_literals` at the top of my models.py
 and removed `__unicode__(self)` but no difference.

 The stacktrace doesn't seem to go through my code anywhere.

 I git-pulled the latest changes to stable/1.5.x from github and
 reinstalled Django after removed the previous installation from dist-
 packages but the problem persists.

 I have not tried deleting this object pythonically; I figured I'd keep
 that object for now in case anyone needs me to reproduce the problem.

 Stacktrace: https://gist.github.com/4148524

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19362>
Django <https://code.djangoproject.com/>
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to