martin-bts / askbot-devel

Askbot is a Django/Python Q&A forum. **Contributors README**: https://github.com/ASKBOT/askbot-devel#how-to-contribute. Commercial hosting of Askbot and support are available at https://askbot.com
Other
0 stars 2 forks source link

SQLite: PermissionDenied: Sorry, you cannot join or leave groups because your account is blocked.</br> Your account might be blocked in error - please contact the site administrators, if you think so. #8

Closed sebastian-philipp closed 5 years ago

sebastian-philipp commented 5 years ago
======================================================================
ERROR: test_low_rep_suspended_can_edit_own_post (askbot.tests.test_permission_assertions.RetagQuestionPermissionAssertionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/sebastian/Repos/askbot-devel/.tox/py2.7/local/lib/python2.7/site-packages/askbot/tests/test_permission_assertions.py", line 651, in setUp
    self,
  File "/home/sebastian/Repos/askbot-devel/.tox/py2.7/local/lib/python2.7/site-packages/askbot/tests/test_permission_assertions.py", line 477, in setUp
    self.create_user(username='other_user', status='a')
  File "/home/sebastian/Repos/askbot-devel/.tox/py2.7/local/lib/python2.7/site-packages/askbot/tests/utils.py", line 162, in create_user
    reputation=reputation
  File "/home/sebastian/Repos/askbot-devel/.tox/py2.7/local/lib/python2.7/site-packages/askbot/tests/utils.py", line 77, in create_user
    user = models.User.objects.create_user(username, email)
  File "/home/sebastian/Repos/askbot-devel/.tox/py2.7/local/lib/python2.7/site-packages/django/contrib/auth/models.py", line 159, in create_user
    return self._create_user(username, email, password, **extra_fields)
  File "/home/sebastian/Repos/askbot-devel/.tox/py2.7/local/lib/python2.7/site-packages/django/contrib/auth/models.py", line 153, in _create_user
    user.save(using=self._db)
  File "/home/sebastian/Repos/askbot-devel/.tox/py2.7/local/lib/python2.7/site-packages/django/contrib/auth/base_user.py", line 80, in save
    super(AbstractBaseUser, self).save(*args, **kwargs)
  File "/home/sebastian/Repos/askbot-devel/.tox/py2.7/local/lib/python2.7/site-packages/django/db/models/base.py", line 808, in save
    force_update=force_update, update_fields=update_fields)
  File "/home/sebastian/Repos/askbot-devel/.tox/py2.7/local/lib/python2.7/site-packages/django/db/models/base.py", line 848, in save_base
    update_fields=update_fields, raw=raw, using=using,
  File "/home/sebastian/Repos/askbot-devel/.tox/py2.7/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 193, in send
    for receiver in self._live_receivers(sender)
  File "/home/sebastian/Repos/askbot-devel/.tox/py2.7/local/lib/python2.7/site-packages/askbot/models/__init__.py", line 4090, in add_user_to_default_groups
    instance.join_default_groups()
  File "/home/sebastian/Repos/askbot-devel/.tox/py2.7/local/lib/python2.7/site-packages/askbot/models/__init__.py", line 2833, in user_join_default_groups
    action='add'
  File "/home/sebastian/Repos/askbot-devel/.tox/py2.7/local/lib/python2.7/site-packages/askbot/models/__init__.py", line 3436, in user_edit_group_membership
    self.assert_can_join_or_leave_group()
  File "/home/sebastian/Repos/askbot-devel/.tox/py2.7/local/lib/python2.7/site-packages/askbot/models/__init__.py", line 903, in user_assert_can_join_or_leave_group
    suspended_user_cannot=True
  File "/home/sebastian/Repos/askbot-devel/.tox/py2.7/local/lib/python2.7/site-packages/askbot/models/__init__.py", line 785, in _assert_user_can
    raise django_exceptions.PermissionDenied(error_message)
PermissionDenied: Sorry, you cannot join or leave groups because your account is blocked.</br> Your account might be blocked in error - please contact the site administrators, if you think so.
sebastian-philipp commented 5 years ago

https://github.com/ASKBOT/askbot-devel/issues/711

martin-bts commented 5 years ago

I just noticed in my testproject/testproject/settings.py I added the line

GROUPS_ENABLED=True

Maybe groups need to be enabled explicitly before one can join or leave groups?

sebastian-philipp commented 5 years ago

Hm. In the Traceback, a newly created user is already blocked, before the user's state is set in the first place. I really suspect that this comes from the database.

martin-bts commented 5 years ago

This is a standing issue in the original Askbot and there aren't any new aspects w.r.t our work. I'm closing this issue