justquick/django-activity-stream — Issue #59: settings.I18N causes endless loop
Author: jpic
Created: 2012-01-16 11:15:43+00:00
State: open

As you can see, Action.__unicode__ renders a template when settings.I18N is true: https://github.com/justquick/django-activity-stream/blob/master/actstream/models.py#L87

So when Django Debug Toolbar template panel wants to show the context of a template which has an Action instance, it will call the __unicode__ representation of the Action instance. Which will render a template (action_short.txt with context 'action'), which DJDT wants to add to the template panel with the context. So it will call the __unicode__ representation of the Action instance which is part of the context. And so on :)

Why are we using a template in __unicode__ anyway ? Isn't there a better way (use gettext like blocktrans) ?