Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when editing with ALLOW_ANON=false #33

Closed
ghtyrant opened this issue Nov 11, 2014 · 0 comments
Closed

Errors when editing with ALLOW_ANON=false #33

ghtyrant opened this issue Nov 11, 2014 · 0 comments

Comments

@ghtyrant
Copy link

Hey!

When editing/creating pages as a registered user in a realms-wiki with ALLOW_ANON set to false, publishing will always fail with "Anonymous posting not allowed".

In realms/modules/wiki/views.py, line 39 and 113 you do:

    if not current_app.config.get('ALLOW_ANON') and current_user.is_anonymous: 
      return dict(error=True, message="Anonymous posting not allowed"), 403

current_user.is_anonymous is a method, not a property, this statement will always be True if ALLOW_ANON is False. adding parentheses helps.

    if not current_app.config.get('ALLOW_ANON') and current_user.is_anonymous(): 
      return dict(error=True, message="Anonymous posting not allowed"), 403
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant