justquick/django-activity-stream — Issue #67: Error If an actionable model is deleted from the db
Author: snanda85
Created: 2012-02-25 14:04:25+00:00
State: open

During the db schema restructuring, I renamed one of my models (which was actionable).
The change was also done in ACTSTREAM_ACTION_MODELS.

The change caused the old content type to be dropped from the db (as expected)

Regarding actstream, I expected that any stream generated on the older models should not be seen anymore.
However, an exception popped up when i tried to generate a stream for an actor.
Below is the traceback:

> Traceback:
> File "/home/nanda/projects/proj/env/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
> 111. response = callback(request, *callback_args, **callback_kwargs)
> File "/home/nanda/projects/proj/env/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
> 23. return view_func(request, *args, **kwargs)
File "/home/nanda/projects/proj/src/apps/users/views.py" in user_profile
> 54. recent_activities = actor_stream(for_user)
File "/home/nanda/projects/proj/env/lib/python2.7/site-packages/actstream/decorators.py" in wrapped
> 26. return func(manager, *args, **kwargs).fetch_generic_relations()
File "/home/nanda/projects/proj/env/lib/python2.7/site-packages/actstream/gfk.py" in fetch_generic_relations
> 66. objects = model_class._default_manager.select_related()
>
> Exception Type: AttributeError at /users/pages/nanda/
> Exception Value: 'NoneType' object has no attribute '_default_manager'