Unverified Commit cf0cbaf1 authored by Enrico Zini's avatar Enrico Zini
Browse files

Also export uid

parent 515fe84b
Pipeline #263596 passed with stage
in 5 minutes and 38 seconds
......@@ -113,6 +113,7 @@ class TestSalsaStatus(BaseFixtureMixin, TestCase):
self.assertJSONEqual(response.content, {
"profile": None,
"status": None,
"uid": None,
})
def test_existing(self):
......@@ -121,9 +122,11 @@ class TestSalsaStatus(BaseFixtureMixin, TestCase):
self.assertJSONEqual(response.content, {
"profile": "/person/dc/",
"status": "dc",
"uid": "dc",
})
response = client.get(reverse("api:salsa_status", kwargs={"subject": 2}))
self.assertJSONEqual(response.content, {
"profile": "/person/dd_nu/",
"status": "dd_nu",
"uid": "dd_nu",
})
......@@ -239,11 +239,13 @@ class SalsaStatus(APIVisitorMixin, APIView):
data = {
"profile": None,
"status": None,
"uid": None,
}
else:
data = {
"profile": identity.person.get_absolute_url(),
"status": identity.person.status,
"uid": identity.person.get_ldap_uid(),
}
res = http.HttpResponse(content_type="application/json")
json.dump(data, res, indent=1, cls=Serializer)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment