Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
code.vt.edu will be down for maintenance from 0530-0630 EDT Wednesday, March 26th
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
59e1f5a5
Commit
59e1f5a5
authored
13 years ago
by
Piotr Mitros
Browse files
Options
Downloads
Patches
Plain Diff
Account already active is there
parent
e3d936ad
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
student/models.py
+1
-1
1 addition, 1 deletion
student/models.py
student/views.py
+5
-3
5 additions, 3 deletions
student/views.py
with
6 additions
and
4 deletions
student/models.py
+
1
−
1
View file @
59e1f5a5
...
...
@@ -48,5 +48,5 @@ class Registration(models.Model):
def
activate
(
self
):
self
.
user
.
is_active
=
True
self
.
user
.
save
()
self
.
delete
()
#
self.delete()
This diff is collapsed.
Click to expand it.
student/views.py
+
5
−
3
View file @
59e1f5a5
...
...
@@ -230,9 +230,11 @@ if settings.GENERATE_RANDOM_USER_CREDENTIALS:
def
activate_account
(
request
,
key
):
r
=
Registration
.
objects
.
filter
(
activation_key
=
key
)
if
len
(
r
)
==
1
:
r
[
0
].
activate
()
resp
=
render_to_response
(
"
activation_complete.html
"
,{
'
csrf
'
:
csrf
(
request
)[
'
csrf_token
'
]})
# print len(connection.queries), connection.queries
if
not
r
[
0
].
user
.
is_active
:
r
[
0
].
activate
()
resp
=
render_to_response
(
"
activation_complete.html
"
,{
'
csrf
'
:
csrf
(
request
)[
'
csrf_token
'
]})
return
resp
resp
=
render_to_response
(
"
activation_active.html
"
,{
'
csrf
'
:
csrf
(
request
)[
'
csrf_token
'
]})
return
resp
if
len
(
r
)
==
0
:
return
render_to_response
(
"
activation_invalid.html
"
,{
'
csrf
'
:
csrf
(
request
)[
'
csrf_token
'
]})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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