First time here? Check out the FAQ!

Revision history  [back]

Inconsistent db after deleting a user?

Viewing a particular user's profile leads to internal server error, with the following traceback:

File "/home/www-data/askbot-devel/askbot/skins/default/templates/user_profile/user_stats.html" in top-level template code
2. {% import "macros.html" as macros %}
File "/home/www-data/askbot-devel/askbot/skins/default/templates/user_profile/user.html" in top-level template code
1. {% extends "one_column_body.html" %}
File "/home/www-data/askbot-devel/askbot/skins/common/templates/one_column_body.html" in top-level template code
1. {% extends "base.html" %}
File "/home/www-data/askbot-devel/askbot/skins/default/templates/base.html" in top-level template code
23.             {% block body %}
File "/home/www-data/askbot-devel/askbot/skins/common/templates/one_column_body.html" in block "body"
5.     {% block content%}
File "/home/www-data/askbot-devel/askbot/skins/default/templates/user_profile/user.html" in block "content"
17.         {% block usercontent %}
File "/home/www-data/askbot-devel/askbot/skins/default/templates/user_profile/user_stats.html" in block "usercontent"
120.                                             title="{{ award.content_object.get_snippet()|collapse }}"

Exception Type: UndefinedError at /qa/users/1/radim/
Exception Value: 'None' has no attribute 'get_snippet'

Other users' profiles work ok, no problem.

I was banging my head against the wall for a while. Then I remember I had been deleting users (test accounts etc), through the admin interface.

My suspicion is that user 1/radim got a badge for one of the questions/answers for a user that was deleted, and now that the user disappeared, some queries fail with the above traceback

Is that possible? Can you think of any other cause for this error? How to fix it now, and what is the recommended way to delete users?

Inconsistent db after deleting a user?

Viewing a particular user's profile leads to internal server error, with the following traceback:

File "/home/www-data/askbot-devel/askbot/skins/default/templates/user_profile/user_stats.html" in top-level template code
2. {% import "macros.html" as macros %}
File "/home/www-data/askbot-devel/askbot/skins/default/templates/user_profile/user.html" in top-level template code
1. {% extends "one_column_body.html" %}
File "/home/www-data/askbot-devel/askbot/skins/common/templates/one_column_body.html" in top-level template code
1. {% extends "base.html" %}
File "/home/www-data/askbot-devel/askbot/skins/default/templates/base.html" in top-level template code
23.             {% block body %}
File "/home/www-data/askbot-devel/askbot/skins/common/templates/one_column_body.html" in block "body"
5.     {% block content%}
File "/home/www-data/askbot-devel/askbot/skins/default/templates/user_profile/user.html" in block "content"
17.         {% block usercontent %}
File "/home/www-data/askbot-devel/askbot/skins/default/templates/user_profile/user_stats.html" in block "usercontent"
120.                                             title="{{ award.content_object.get_snippet()|collapse }}"

Exception Type: UndefinedError at /qa/users/1/radim/
Exception Value: 'None' has no attribute 'get_snippet'

Other users' profiles work ok, no problem.

I was banging my head against the wall for a while. Then I remember I had been deleting users (test accounts etc), through the admin interface.

My suspicion is that user 1/radim got a badge for one of the questions/answers for a user that was deleted, and now that the user disappeared, some queries fail with the above traceback

Is that possible? Can you think of any other cause for this error? How to fix it now, and what is the recommended way to delete users?