Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
rpteam
Revue de Press
Commits
198b237d
Commit
198b237d
authored
Mar 19, 2019
by
Okhin
Browse files
Working on stuff
parent
526de187
Pipeline
#2506
passed with stages
in 2 minutes and 55 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
apps/userprofile/apps.py
View file @
198b237d
...
...
@@ -3,3 +3,6 @@ from django.apps import AppConfig
class
UserprofileConfig
(
AppConfig
):
name
=
'userprofile'
def
ready
(
self
):
import
userprofile.signals
apps/userprofile/signals.py
0 → 100644
View file @
198b237d
from
django.core.signals
import
post_save
from
django.dispatch
import
receiver
from
rest_framework.authtoken.models
import
Token
from
django.conf
import
settings
@
receiver
(
post_save
,
sender
=
settings
.
AUTH_USER_MODEL
)
def
create_user_token
(
sender
,
instance
=
None
,
created
=
False
,
*
args
,
**
wkargs
):
if
created
:
Token
.
objects
.
create
(
user
=
instance
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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