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

API returns true instead of NULL for last_modified_at fields #477

Closed
zzgvh opened this issue Mar 24, 2014 · 5 comments
Closed

API returns true instead of NULL for last_modified_at fields #477

zzgvh opened this issue Mar 24, 2014 · 5 comments
Assignees
Milestone

Comments

@zzgvh
Copy link
Contributor

zzgvh commented Mar 24, 2014

The organisation and project resources last_modified_at fields are not populated for all objects, so some of them have a NULL value. However the API returns those fields as boolean true which is clearly incorrect in a very surprising way.

Examples: http://rsr.akvo.org/api/v1/project/1880/?format=json and http://rsr.akvo.org/api/v1/organisation/1880/?format=xml

This is not an issue with project updates since they all have a populated last_modified_at, but a fix should be checked to work for project updates too.

@adriancollier
Copy link
Contributor

I think we need to run a script to populate the created and modified dates for all projects and organisations in the DB.

We may still need to resolve this issue in the API as well - as I agree this is not expected behaviour, but all newly created objects should also already have these fields populated right?

@KasperBrandt
Copy link
Contributor

I've now updated the API to show null instead of True. For populating the fields we need to set some sort of default, since we don't know when these projects / organisations have been created.

zzgvh added a commit that referenced this issue Jun 13, 2014
[#477] Empty date fields in API return null instead of True
@KasperBrandt
Copy link
Contributor

Merged in #623

@KasperBrandt
Copy link
Contributor

Test plan

GIVEN the API for organisation, project and project updates
WHEN the created_at or last_modified_at datefields are empty
THEN the API should return 'null' instead of 'True'

@rumca
Copy link
Contributor

rumca commented Jul 2, 2014

I've tested with:

http://rsr.akvouat.org/api/v1/organisation/?format=json&limit=200
http://rsr.akvouat.org/api/v1/project/?format=json&limit=200&partnerships__organisation=420

both of which populate created_at and last_modified_at with null instead of true

The project updates API call doesn't return either of these fields

@MichaelAkvo MichaelAkvo moved this to Done in RSR Dec 8, 2022
@MichaelAkvo MichaelAkvo added this to RSR Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants