Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
La Quadrature du Net
rpteam
rp
Commits
198b237d
Commit
198b237d
authored
Mar 19, 2019
by
Okhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on stuff
parent
526de187
Pipeline
#2506
passed with stages
in 2 minutes and 55 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
apps/userprofile/apps.py
apps/userprofile/apps.py
+3
-0
apps/userprofile/signals.py
apps/userprofile/signals.py
+10
-0
No files found.
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