Fix delete URL for custom organizations#374
Merged
Merged
Conversation
Member
|
This looks good to me @avdata99, maybe you can update the description to include a description / screenshot of the error so it's easier to understand the context |
Member
Author
|
I updated the description here @amercader |
Member
|
@wardi any objections to merge this? |
Contributor
|
@amercader thank you for reviewing |
Member
Author
|
@amercader @wardi, If you think it's appropriate, could you please create the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are an error deleting an organization with datasets (using a custom organization type)
Example

After
manage->delete(my custom type is called Data Container)
If I go back to the container again I see Data Container cannot be deleted while it still has datasets
Error log
ERROR [ckan.config.middleware.flask_app] 'organization' Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/flask/app.py", line 1949, in full_dispatch_request | rv = self.dispatch_request() | File "/usr/lib/python3.8/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/srv/app/src/ckan/ckan/config/middleware/../../views/group.py", line 450, in read extra_vars = _read(id, limit, group_type) | File "/srv/app/src/ckan/ckan/config/middleware/../../views/group.py", line 371, in _read _setup_template_variables(context, {u'id': id}, group_type=group_type) | File "/srv/app/src/ckan/ckan/config/middleware/../../views/group.py", line 66, in _setup_template_variables return lookup_group_plugin(group_type).\ File "/srv/app/src/ckanext-scheming/ckanext/scheming/plugins.py", line 167, in setup_template_variables c.scheming_schema = self._schemas[group_type] KeyError: 'organization' INFO [ckan.config.middleware.flask_app] 500 /organization/container_test render time 0.294 secondsThis is because the
deletebutton for organization goes to a bad URLCKAN core generates the
deletebutton URL this way:group_type + '.delete'https://github.com/ckan/ckan/blob/master/ckan/templates/organization/snippets/organization_form.html#L40
We need to generate the
deleteURL in the same way in this extension