-
Notifications
You must be signed in to change notification settings - Fork 20
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
API returns duplicate project updates #206
Comments
This can be resolved by adding distinct=True to the query string. The call above would then look like this: Oli commented online that distinct=True should be the default behavior and that sounds like a good idea. |
Duplicates should probably still happen when using the depth param since you will get different associated data for the duplicates of the "main" objects. |
Perhaps rather use the logic behind the depth param to determine when to return duplicates and otherwise return distinct results as discussed above. |
@zzgvh Is there a change needed in our API or should we just advise all our partners and modify our documentation to mentioned that distinct should be used on live API calls? |
@zzgvh your thoughts on this? Just wondering if we need to plan change for coding or for documentation/advice? |
Coding done, but I'm not "publishing" it before we have a pull request workflow in place. |
When querying the API using the depth paramter there are cases where you can get multiple copies of the same related object, when that object is related to more than one object of the "root" kind. Change this so duplicates are filtered out by default. If for some reason the dupicates are needed use distinct=False in the query string of the request.
The fix was so small it felt like overkill to make a branch and pull request. |
Reviewed |
The RSR API call to retrieve project updates returns two of each update, e.g.
http://www.akvo.org/api/v1/project_update/?format=json&project__partnerships__organisation=912
The text was updated successfully, but these errors were encountered: