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

Legacy API has changed the number of item lists #2364

Closed
stellanl opened this issue Sep 16, 2016 · 3 comments
Closed

Legacy API has changed the number of item lists #2364

stellanl opened this issue Sep 16, 2016 · 3 comments

Comments

@stellanl
Copy link
Contributor

stellanl commented Sep 16, 2016

Up versions before 1.6 fetch user info from this API:
http://rsr.akvo.org/api/v1/user/2/?depth=1&format=xml

The organisation connection depends on the last object of the last list of the user object to have a valid organisation id tag

<object>
<username>thomas</username>
<first_name>Thomas</first_name>
<last_name>Bjelkeman-Pettersson</last_name>
...
<organisations>
 <object>
 <id>42</id>
 </object>
</organisations>
</object>

The legacy version of the /api/v1 API has the <approved_employments> list last, which confuses the 1.5 Up parser. (It was refactored completely for 1.6 and now uses the /rest/v1?format=json API.)

@punchagan
Copy link
Contributor

Edited to make the xml a code-block. Tags weren't displayed, otherwise.

@zzgvh
Copy link
Contributor

zzgvh commented Sep 16, 2016

Since there are now multiple orgs a user can be associated with, which one do I choose if there are several?

zzgvh added a commit that referenced this issue Sep 16, 2016
To support older versions of Up include the fields "user_profile" and "username" in the "user" endpoint when accessing it using the /api/v1/ base URL that used to be the Tastypie API but is now emulated using django-rest-framework.
zzgvh added a commit that referenced this issue Sep 19, 2016
#2364 up user fixes. Merging to get this testable on rsr.test.akvo.org.
@stellanl stellanl changed the title user_profile item gone from legacy API Legacy API has changed the number of item lists Sep 20, 2016
@zzgvh
Copy link
Contributor

zzgvh commented Sep 22, 2016

Fixed in #2370

@zzgvh zzgvh closed this as completed Sep 22, 2016
@zzgvh zzgvh removed the In Progress label Sep 22, 2016
zzgvh added a commit that referenced this issue Sep 27, 2016
To support older versions of Up include the fields "user_profile" and "username" in the "user" endpoint when accessing it using the /api/v1/ base URL that used to be the Tastypie API but is now emulated using django-rest-framework.
zzgvh added a commit that referenced this issue Sep 27, 2016
@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