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
14
Issues
14
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
f916864f
Verified
Commit
f916864f
authored
Oct 18, 2017
by
Thibaut Broggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add user to group "Padawan" on registration
parent
1486ce3e
Pipeline
#1428
passed with stages
in 1 minute and 55 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
apps/rp/forms.py
apps/rp/forms.py
+7
-1
project/settings/auth.py
project/settings/auth.py
+1
-0
No files found.
apps/rp/forms.py
View file @
f916864f
from
django
import
forms
from
django.contrib.auth.models
import
Group
class
TagMultipleChoiceField
(
forms
.
ModelMultipleChoiceField
):
def
prepare_value
(
self
,
value
):
...
...
@@ -15,3 +15,9 @@ class TagMultipleChoiceField(forms.ModelMultipleChoiceField):
self
.
validate
(
value
)
self
.
run_validators
(
value
)
return
value
class
SignupForm
(
forms
.
Form
):
def
signup
(
self
,
request
,
user
):
group
=
Group
.
objects
.
get
(
name
=
'Padawan'
)
user
.
groups
.
add
(
group
)
user
.
save
()
project/settings/auth.py
View file @
f916864f
...
...
@@ -41,3 +41,4 @@ AUTH_PASSWORD_VALIDATORS = [
# Disable two steps logout
ACCOUNT_LOGOUT_ON_GET
=
True
ACCOUNT_SIGNUP_FORM_CLASS
=
"rp.forms.SignupForm"
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