Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Debian New Member Process
nm.debian.org
Commits
cf0cbaf1
Unverified
Commit
cf0cbaf1
authored
Jun 21, 2021
by
Enrico Zini
Browse files
Also export uid
parent
515fe84b
Pipeline
#263596
passed with stage
in 5 minutes and 38 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
api/tests.py
View file @
cf0cbaf1
...
...
@@ -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"
,
})
api/views.py
View file @
cf0cbaf1
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment