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
190a4357
Verified
Commit
190a4357
authored
6 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Fix #198: Removed Python 3.6 dependency (secrets module)
parent
db4c1356
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/funkwhale_api/users/models.py
+7
-2
7 additions, 2 deletions
api/funkwhale_api/users/models.py
changes/changelog.d/198.bugfix
+1
-0
1 addition, 0 deletions
changes/changelog.d/198.bugfix
with
8 additions
and
2 deletions
api/funkwhale_api/users/models.py
+
7
−
2
View file @
190a4357
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
,
absolute_import
import
binascii
import
os
import
uuid
import
secrets
from
django.conf
import
settings
from
django.contrib.auth.models
import
AbstractUser
...
...
@@ -14,6 +15,10 @@ from django.utils.translation import ugettext_lazy as _
from
funkwhale_api.common
import
fields
def
get_token
():
return
binascii
.
b2a_hex
(
os
.
urandom
(
15
)).
decode
(
'
utf-8
'
)
@python_2_unicode_compatible
class
User
(
AbstractUser
):
...
...
@@ -58,7 +63,7 @@ class User(AbstractUser):
return
self
.
secret_key
def
update_subsonic_api_token
(
self
):
self
.
subsonic_api_token
=
secrets
.
token_hex
(
32
)
self
.
subsonic_api_token
=
get_token
(
)
return
self
.
subsonic_api_token
def
set_password
(
self
,
raw_password
):
...
...
This diff is collapsed.
Click to expand it.
changes/changelog.d/198.bugfix
0 → 100644
+
1
−
0
View file @
190a4357
Removed Python 3.6 dependency (secrets module) (#198)
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