First time here? Check out the FAQ!
1

Bug: Deleting a User

Please advise how to resolve:

Deleting a user from admin/auth/user/XXX/delete/ leads to:

DatabaseError: (1146, "Table 'askbot.group_messaging_lastvisittime' doesn't exist")

Traceback (most recent call last):

File "/usr/local/lib/python2.7/dist-packages/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/contrib/admin/options.py", line 366, in wrapper return self.admin_site.admin_view(view)(args, *kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 91, in _wrapped_view response = view_func(request, args, *kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/cache.py", line 89, in _wrapped_view_func response = view_func(request, args, *kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/sites.py", line 196, in inner return view(request, args, *kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 25, in _wrapper return bound_func(args, *kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 91, in _wrapped_view response = view_func(request, args, *kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 21, in bound_func return func(self, args2, *kwargs2)

File "/usr/local/lib/python2.7/dist-packages/django/db/transaction.py", line 209, in inner return func(args, *kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/options.py", line 1274, in delete_view [obj], opts, request.user, self.admin_site, using)

File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/util.py", line 104, in get_deleted_objects collector.collect(objs)

File "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/util.py", line 155, in collect return super(NestedObjects, self).collect(objs, source_attr=source_attr, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/db/models/deletion.py", line 175, in collect if not sub_objs:

File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 130, in __nonzero__ iter(self).next()

File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 118, in _result_iter self._fill_cache()

File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 875, in _fill_cache self._result_cache.append(self._iter.next())

File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 291, in iterator for row in compiler.results_iter():

File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 763, in results_iter for rows in self.execute_sql(MULTI):

File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 818, in execute_sql cursor.execute(sql, params)

File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 114, in execute return self.cursor.execute(query, args)

File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 201, in execute self.errorhandler(self, exc, value)

File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler raise errorclass, errorvalue

DatabaseError: (1146, "Table 'askbot.group_messaging_lastvisittime' doesn't exist")

Note that this database was migrated successfully from 0.6 ... (more)

Rupreck's avatar
305
Rupreck
asked 2013-09-18 03:31:02 -0600
edit flag offensive 0 remove flag close merge delete

Comments

1

"Table does not exist" points to an issue in the database - a missing table - try running `python manage.py syncdb --migrate`.

Evgeny's avatar Evgeny (2013-09-23 11:30:14 -0600) edit
add a comment see more comments

1 Answer

1

It's better to not delete any user. And only move this user to blocked user group.

Blocked users can only login and send feedback to the site administrators, their url and profile will also be hidden.

Mustafa's avatar
48
Mustafa
answered 2013-09-23 07:57:27 -0600
edit flag offensive 0 remove flag delete link

Comments

2

The Problem is when you have to block 100 users. You need too much time, but deleting via /admin panel is faster, because you can find all users with emails a@fake.com, b@fake.com ,... at once

Toms's avatar Toms (2013-09-23 10:47:40 -0600) edit
1

@Toms that's a good point, we'll need to implement bulk user moderation in the future versions.

Evgeny's avatar Evgeny (2013-09-23 11:28:48 -0600) edit
1

@Evgeny @Toms there was this bulk user moderation features in OSQA, which I liked for such purposes. I don't know why it was removed for Askbot.

pajju's avatar pajju (2013-09-28 01:35:18 -0600) edit
add a comment see more comments