Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zwordi
funkwhale
Commits
b23e87e1
Verified
Commit
b23e87e1
authored
5 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Fix
#798
: Allow users with dots in their usernames to request a subsonic password
parent
71b7f416
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
api/funkwhale_api/users/views.py
+1
-0
1 addition, 0 deletions
api/funkwhale_api/users/views.py
api/tests/users/test_views.py
+15
-0
15 additions, 0 deletions
api/tests/users/test_views.py
changes/changelog.d/798.bugfix
+1
-0
1 addition, 0 deletions
changes/changelog.d/798.bugfix
with
17 additions
and
0 deletions
api/funkwhale_api/users/views.py
+
1
−
0
View file @
b23e87e1
...
...
@@ -28,6 +28,7 @@ class UserViewSet(mixins.UpdateModelMixin, viewsets.GenericViewSet):
queryset
=
models
.
User
.
objects
.
all
()
serializer_class
=
serializers
.
UserWriteSerializer
lookup_field
=
"
username
"
lookup_value_regex
=
r
"
[a-zA-Z0-9-_.]+
"
required_scope
=
"
profile
"
@action
(
methods
=
[
"
get
"
],
detail
=
False
)
...
...
This diff is collapsed.
Click to expand it.
api/tests/users/test_views.py
+
15
−
0
View file @
b23e87e1
...
...
@@ -225,6 +225,21 @@ def test_user_can_get_subsonic_token(logged_in_api_client):
assert
response
.
data
==
{
"
subsonic_api_token
"
:
"
test
"
}
def
test_user_can_request_new_subsonic_token_uncommon_username
(
logged_in_api_client
):
user
=
logged_in_api_client
.
user
user
.
username
=
"
firstname.lastname
"
user
.
subsonic_api_token
=
"
test
"
user
.
save
()
url
=
reverse
(
"
api:v1:users:users-subsonic-token
"
,
kwargs
=
{
"
username
"
:
user
.
username
}
)
response
=
logged_in_api_client
.
post
(
url
)
assert
response
.
status_code
==
200
def
test_user_can_delete_subsonic_token
(
logged_in_api_client
):
user
=
logged_in_api_client
.
user
user
.
subsonic_api_token
=
"
test
"
...
...
This diff is collapsed.
Click to expand it.
changes/changelog.d/798.bugfix
0 → 100644
+
1
−
0
View file @
b23e87e1
Allow users with dots in their usernames to request a subsonic password (#798)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment