Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
oser-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Hamza Touizrat
oser-backend
Commits
703e48cb
Commit
703e48cb
authored
2 years ago
by
salazard
Browse files
Options
Downloads
Patches
Plain Diff
fix email verification
parent
11afdd6e
Branches
Branches containing commit
No related tags found
1 merge request
!61
Verification mail
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
oser_backend/settings/common.py
+3
-0
3 additions, 0 deletions
oser_backend/settings/common.py
register/signals.py
+4
-9
4 additions, 9 deletions
register/signals.py
users/forms.py
+4
-4
4 additions, 4 deletions
users/forms.py
with
11 additions
and
13 deletions
oser_backend/settings/common.py
+
3
−
0
View file @
703e48cb
...
@@ -254,6 +254,7 @@ EMAIL_HOST_USER = 'apikey'
...
@@ -254,6 +254,7 @@ EMAIL_HOST_USER = 'apikey'
EMAIL_HOST_PASSWORD
=
SENDGRID_API_KEY
EMAIL_HOST_PASSWORD
=
SENDGRID_API_KEY
EMAIL_PORT
=
587
EMAIL_PORT
=
587
EMAIL_USE_TLS
=
True
EMAIL_USE_TLS
=
True
LOGIN_URL
=
os
.
getenv
(
'
LOGIN_URL
'
)
# Toggle sandbox mode (when running in DEBUG mode)
# Toggle sandbox mode (when running in DEBUG mode)
SENDGRID_SANDBOX_MODE_IN_DEBUG
=
False
SENDGRID_SANDBOX_MODE_IN_DEBUG
=
False
...
@@ -298,3 +299,5 @@ TELEGRAM = {
...
@@ -298,3 +299,5 @@ TELEGRAM = {
'
channel_name
'
:
'
oserSECGEN
'
,
'
channel_name
'
:
'
oserSECGEN
'
,
'
production
'
:
False
,
'
production
'
:
False
,
}
}
VERIFICATION_SUCCESS_TEMPLATE
=
None
This diff is collapsed.
Click to expand it.
register/signals.py
+
4
−
9
View file @
703e48cb
...
@@ -19,15 +19,10 @@ registration_created = Signal(
...
@@ -19,15 +19,10 @@ registration_created = Signal(
def
create_user_and_student
(
sender
,
instance
:
Registration
,
request
,
validated_data
,
def
create_user_and_student
(
sender
,
instance
:
Registration
,
request
,
validated_data
,
password
:
str
,
**
kwargs
):
password
:
str
,
**
kwargs
):
"""
Create a user and student after on a registration_created signal.
"""
"""
Create a user and student after on a registration_created signal.
"""
# user = User.objects.create_user(
# email=instance.email,
validated_data
[
'
password1
'
]
=
password
# password=password,
validated_data
[
'
password2
'
]
=
password
# first_name=instance.first_name,
# last_name=instance.last_name,
# phone_number=instance.phone_number,
# is_active=False,
# )
validated_data
[
'
password
'
]
=
password
form
=
UserForm
(
validated_data
)
form
=
UserForm
(
validated_data
)
if
form
.
is_valid
():
if
form
.
is_valid
():
user
=
send_verification_email
(
user
=
send_verification_email
(
...
...
This diff is collapsed.
Click to expand it.
users/forms.py
+
4
−
4
View file @
703e48cb
from
django.forms
import
ModelForm
,
TextInput
,
EmailInput
from
django.forms
import
ModelForm
,
TextInput
,
EmailInput
from
.models
import
User
from
.models
import
User
from
users.model
s
import
User
from
django.contrib.auth.form
s
import
User
CreationForm
class
UserForm
(
Model
Form
):
class
UserForm
(
UserCreation
Form
):
class
Meta
:
class
Meta
(
UserCreationForm
.
Meta
)
:
model
=
User
model
=
User
fields
=
[
"
email
"
,
"
password
"
,
"
first_name
"
,
fields
=
[
"
email
"
,
"
first_name
"
,
"
last_name
"
,
"
phone_number
"
]
"
last_name
"
,
"
phone_number
"
]
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