Closed Bug 1120480 Opened 10 years ago Closed 10 years ago

taken_by returns a user id that we can't compare

Categories

(support.mozilla.org :: Questions, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rik, Assigned: mythmon)

References

Details

(Whiteboard: p=0 c=questions u=api s=2015.1)

We need to compare taken_by with the current user. We don't know the user id and the question api returns one. So we either need a user id returned by the User API or a username returned by the Question API.
This is an easy fix. I'll do it now.
Whiteboard: p=0 c=questions u=api s=2015.1
This PR makes it so all references to users on the question and answer serializers use `{username: 'bob', display_name: 'Bobert'}` style for ever field that references a user. https://github.com/mozilla/kitsune/pull/2305
Will this work for the solver_id as well and give the username instead of the id?
I'll make a pass to make sure that users aren't referenced by id in output or in filtering. You should be able to use queries like /api/2/question/?solver=mythmon. If it isn't working like that today, that's a bug.
metadata currently shows {"name":"solver_id","value":"997124"} if the thread is solved ("is_solved":true and "solution": not null) It would be nice if this could be the username
a) Those fields shouldn't be in metadata, but should be full fledged fields of their own. b) You're right. And in fact a commit I have written by haven't deployed yet turns solver into an object that has username and display_name.
You need to log in before you can comment on or make changes to this bug.