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

Wrong Exception in package_collaborator_create #5759

Closed
pdekraker-epa opened this issue Nov 23, 2020 · 1 comment · Fixed by #5763
Closed

Wrong Exception in package_collaborator_create #5759

pdekraker-epa opened this issue Nov 23, 2020 · 1 comment · Fixed by #5763
Assignees

Comments

@pdekraker-epa
Copy link
Contributor

CKAN version
2.9.1

Describe the bug
When attempting to add a non-existent user as a dataset collaborator a NotAuthorized exception is raised, which should probably be a validation or not found exception. The message 'Not allowed to add collaborators' also does not make sense for the underlying cause. When using this functionality via the web interface (at least in my implementation) the NotAuthorized exception logs the user out, which is not desired behavior.

raise NotAuthorized(_('Not allowed to add collaborators'))

@amercader amercader self-assigned this Nov 24, 2020
amercader added a commit that referenced this issue Nov 26, 2020
Instead of the current NotAuthorized exception we were raising. Also
redirect to the Add collaborator form when there is an error instead of
the collaborators list page.
amercader added a commit that referenced this issue Nov 26, 2020
Instead of the current `NotAuthorized`  exception we were raising. Also
redirect to the Add collaborator form when there is an error instead of
the collaborators list page.

Fixes #5759
@amercader
Copy link
Member

Thanks @pdekraker-epa, I've created a PR for this #5763

wardi added a commit that referenced this issue Dec 1, 2020
[#5759] Raise NotFound when creating a non-existing collaborator
amercader added a commit that referenced this issue Jan 15, 2021
Instead of the current `NotAuthorized`  exception we were raising. Also
redirect to the Add collaborator form when there is an error instead of
the collaborators list page.

Fixes #5759
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 a pull request may close this issue.

2 participants