Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
da63d852
authored
Sep 08, 2016
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: disable overwriting existing 2fa codes
parent
269e1b6c
Pipeline
#200
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
circle/dashboard/views/user.py
+8
-0
No files found.
circle/dashboard/views/user.py
View file @
da63d852
...
...
@@ -583,6 +583,14 @@ class EnableTwoFactorView(LoginRequiredMixin, UpdateView):
template_name
=
"dashboard/enable-two-factor.html"
success_url
=
reverse_lazy
(
"dashboard.views.profile-preferences"
)
def
dispatch
(
self
,
*
args
,
**
kwargs
):
if
self
.
get_object
()
.
two_factor_secret
:
messages
.
info
(
self
.
request
,
_
(
"Two-factor authentication is al"
"ready enabled for your account."
))
return
redirect
(
reverse
(
"dashboard.index"
))
return
super
()
.
dispatch
(
*
args
,
**
kwargs
)
def
get_object
(
self
,
queryset
=
None
):
if
self
.
request
.
user
.
is_anonymous
():
raise
PermissionDenied
...
...
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