Problem deleting notifications

asked 2013-01-23 15:23:47 -0500

mornaner gravatar image

Trying to delete all notifications raises this error:

Traceback (most recent call last):

File "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python2.7/dist-packages/Django-1.4.2-py2.7.egg/django/views/decorators/csrf.py", line 77, in wrapped_view
    return view_func(*args, **kwargs)

File "/var/www/askbot-devel/askbot/views/commands.py", line 876, in read_message
    request.user.delete_messages()

File "/var/www/askbot-devel/askbot/models/__init__.py", line 2284, in delete_messages
    self.message_set.all().delete()

AttributeError: 'RelatedObjectSimulator' object has no attribute 'all'
edit retag flag offensive close merge delete

Comments

Could you try the latest code now, I've added the .all() method.

Evgeny gravatar imageEvgeny ( 2013-01-23 23:01:38 -0500 )edit

@Evgeny Just tested it and it works. If you put it as an answer I'll accept it.

mornaner gravatar imagemornaner ( 2013-01-24 14:09:14 -0500 )edit