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

can not edit read-only resources -- datastore test problem #1763

Merged
merged 1 commit into from
Nov 5, 2014

Conversation

amercader
Copy link
Member

when i run the test up for datastore with api curl -X POST http://127.0.0.1:5000/api/3/action/datastore_create -H "Authorization: {YOUR-API-KEY}" -d '{"resource_id": "{RESOURCE-ID}", "fields": [ {"id": "a"}, {"id": "b"} ], "records": [ { "a": 1, "b": "xyz"}, {"a": 2, "b": "zzz"} ]}'

i changed the api key and resource id

i received that can not edit read-only resources, either pass force=true or change url type

then where to add force=true ?

thanks

@yao2347
Copy link
Author

yao2347 commented Jun 11, 2014

can anyone help? thanks

@amercader amercader self-assigned this Jun 12, 2014
@sepandar-sepehr
Copy link

I have the same issue, you can fix this test by adding force true in this way:
when i run the test up for datastore with api curl -X POST http://127.0.0.1:5000/api/3/action/datastore_create -H "Authorization: {YOUR-API-KEY}" -d '{"resource_id": "{RESOURCE-ID}", "fields": [ {"id": "a"}, {"id": "b"} ], "records": [ { "a": 1, "b": "xyz"}, {"a": 2, "b": "zzz"} ], "force":"True}'

But I don't think this is a good idea since you cannot go in code and add force true to everything. My datastore upload gives me an error now and I believe it is because of the permission issues. So I guess there is a problem with permission setup of Datastore in 2.3.

Can anybody more knowledgeable help?

@amercader
Copy link
Member

The docs need to be updated to

curl -X POST http://127.0.0.1:5000/api/3/action/datastore_create -H "Authorization: {YOUR-API-KEY}" -d '{"resource": {"package_id": "{PACKAGE-ID}"}, "fields": [ {"id": "a"}, {"id": "b"} ], "records": [ { "a": 1, "b": "xyz"}, {"a": 2, "b": "zzz"} ]}' 

To avoid a "use force=True" message, create a datastore only resource.
@amercader amercader removed their assignment Nov 4, 2014
@brew brew self-assigned this Nov 4, 2014
brew added a commit that referenced this pull request Nov 5, 2014
can not edit read-only resources -- datastore test problem
@brew brew merged commit ab9242d into master Nov 5, 2014
@smotornyuk smotornyuk deleted the 1763-update-datastore-docs branch December 19, 2018 15:01
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.

None yet

4 participants