Problem deleting notifications

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'
mornaner's avatar
109
mornaner
asked 2013-01-23 15:23:47 -0600
edit flag offensive 0 remove flag close merge delete

Comments

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

Evgeny's avatar Evgeny (2013-01-23 23:01:38 -0600) edit

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

mornaner's avatar mornaner (2013-01-24 14:09:14 -0600) edit
add a comment see more comments