You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works fine for links, but not when using the filestore. When using filestore, and an administrator creates a dataset with a file, everything works fine - but when it is an ordinary user the system crashes. It doesn't seem to be the file uploader but rather the page that should display the new dataset after completion.
The text was updated successfully, but these errors were encountered:
@glagnar calling package_update from within an after_update method seems like a bad idea. I'm reasonably sure the package_update code wasn't designed to be re-entrant.
Could you try just modifying the data_dict from a before_update method? Or use the approach I'm more familiar with: implement it with validators in an IDatasetForm plugin. I know that would work.
@wardi Thanks for the suggestions. Unfortunately the IPackageController does not have a before_update. The code I have submitted seems to work fine - unless the user is not administrator. I suspect a bug in CKAN 2.2.2. I have just now installed my plugin in CKAN 2.3 and everything seems to work perfectly.
glagnar
changed the title
Crash using IPackageController extension after_update to make dataset private
Crash using IPackageController extension after_update to make dataset private in CKAN 2.2.2
May 1, 2015
Confirming how little I know about IPackageController :-)
Calling package_update from within a function that is called by package_update is still a really bad idea, and recommend you use an IDatasetForm validator instead.
I have created this extension, to override the 'private' property of datasets. It must always be private for new datasets.
This works fine for links, but not when using the filestore. When using filestore, and an administrator creates a dataset with a file, everything works fine - but when it is an ordinary user the system crashes. It doesn't seem to be the file uploader but rather the page that should display the new dataset after completion.
The text was updated successfully, but these errors were encountered: