Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osmaxx
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ifs
geometalab
osmaxx
Commits
d118d4ad
Commit
d118d4ad
authored
8 years ago
by
Raphael Das Gupta
Browse files
Options
Downloads
Patches
Plain Diff
refactoring: rename function to "send_email_confirmation"
parent
a7391ef8
No related branches found
No related tags found
1 merge request
!850
Feature/move _send_email_verification to models.profile
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
osmaxx/profile/email_confirmation.py
+1
-1
1 addition, 1 deletion
osmaxx/profile/email_confirmation.py
osmaxx/profile/views.py
+4
-4
4 additions, 4 deletions
osmaxx/profile/views.py
with
5 additions
and
5 deletions
osmaxx/profile/email_confirmation.py
+
1
−
1
View file @
d118d4ad
...
...
@@ -10,7 +10,7 @@ from django.utils.translation import ugettext as _
RATE_LIMIT_SECONDS
=
30
def
_
send_email_
verific
ation
(
request
,
profile
):
def
send_email_
confirm
ation
(
request
,
profile
):
if
cache
.
get
(
profile
.
associated_user
.
id
):
return
to_email
=
profile
.
unverified_email
...
...
This diff is collapsed.
Click to expand it.
osmaxx/profile/views.py
+
4
−
4
View file @
d118d4ad
...
...
@@ -7,7 +7,7 @@ from django.shortcuts import redirect
from
django.utils.translation
import
ugettext
as
_
from
django.views
import
generic
from
osmaxx.profile.email_confirmation
import
_
send_email_
verific
ation
from
osmaxx.profile.email_confirmation
import
send_email_
confirm
ation
from
osmaxx.profile.forms
import
ProfileForm
from
osmaxx.profile.models
import
Profile
...
...
@@ -35,7 +35,7 @@ class ProfileView(LoginRequiredMixin, generic.UpdateView):
)
if
self
.
is_new_user
():
self
.
_move_email_from_user_to_profile
(
user
,
profile
)
_
send_email_
verific
ation
(
self
.
request
,
profile
)
send_email_
confirm
ation
(
self
.
request
,
profile
)
else
:
self
.
_ensure_profile_has_email
(
profile
,
user
)
user
.
refresh_from_db
()
...
...
@@ -52,7 +52,7 @@ class ProfileView(LoginRequiredMixin, generic.UpdateView):
if
isinstance
(
response
,
HttpResponseRedirect
):
# successful form validation
profile
=
Profile
.
objects
.
get
(
associated_user
=
self
.
request
.
user
)
if
not
profile
.
has_validated_email
():
_
send_email_
verific
ation
(
self
.
request
,
profile
=
profile
)
send_email_
confirm
ation
(
self
.
request
,
profile
=
profile
)
return
response
def
_ensure_profile_has_email
(
self
,
profile
,
user
):
...
...
@@ -101,7 +101,7 @@ class ResendVerificationEmail(LoginRequiredMixin, generic.RedirectView):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
profile
=
Profile
.
objects
.
get
(
associated_user
=
self
.
request
.
user
)
_
send_email_
verific
ation
(
self
.
request
,
profile
=
profile
)
send_email_
confirm
ation
(
self
.
request
,
profile
=
profile
)
return
super
().
get
(
request
,
*
args
,
**
kwargs
)
...
...
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