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

fix anon views #8

Merged
merged 2 commits into from
Aug 28, 2024
Merged

fix anon views #8

merged 2 commits into from
Aug 28, 2024

Conversation

avdata99
Copy link
Member

@avdata99 avdata99 commented Aug 28, 2024

If a user goes directly to a private view, we get an error

Error log

    'str' object has no attribute 'sysadmin' [(AttributeError)]
    TRACE
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3.10/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/srv/app/src/ckanext-announcements/ckanext/announcements/blueprints.py", line 17, in index
    if not toolkit.c.userobj.sysadmin:
AttributeError: 'str' object has no attribute 'sysadmin'
    on page /ckan-admin/announcements/

@avdata99 avdata99 merged commit 4efba23 into main Aug 28, 2024
6 checks passed
@avdata99 avdata99 deleted the fix_anon_views branch August 28, 2024 11:48
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

Successfully merging this pull request may close these issues.

1 participant