$ ckanapi action rating_create package=test_dataset rating=1
Traceback (most recent call last):
...
ckan.logic.ValidationError: None - {'message': 'Rating must be between 1 and 5.'}
https://github.com/ckan/ckan/blob/master/ckan/logic/action/create.py#L957-L962
rating_create converts to an int, then uses the original string provided for a < and > comparison. Either I am missing something, or this is clearly never used, because it does not work. Delete or move all validation to a schema?
The more I think about this code, the more broken it is, if you provide an int, by calling via get_action in python code, because it uses a try/except/else cause, you can provide an integer not in the range [1, 5].
Can we just deprecate and delete?
I support getting rid of rating stuff. And if it doesn't work then no need to deprecate it first.
wardi agrees ratings are not valuable
Hi,
fyi: since our new instances need ratings and we noticed that this actually is quite broken and unsupported we decided to implement this as a extensions ckanext-ratings or something and we probably released it a few weeks.
Nice one!
If it definitely doesn't work in core then we don't need to deprecate it before we remove the code. Can you point to the problem or error?
Ah, I see joe already confirmed this. Perhaps someone could just delete the code in a PR?
Through HTTP api ratings "work" but for example for anonymous users ip addresses are not handled and anonymous user can give only one rating per package, so it really is totally broken and probably should be removed.
+1 to remove and point to @Zharktas extension
Our extension can be found here https://github.com/6aika/ckanext-rating :)
Most helpful comment
+1 to remove and point to @Zharktas extension