Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
0e72884e
Commit
0e72884e
authored
Mar 28, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better logging. Tested and fixed bugs in previous commits
parent
0cb798b4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
8 deletions
+10
-8
djangoapps/student/models.py
+4
-4
djangoapps/student/views.py
+4
-2
templates/emails/confirm_email_change.txt
+1
-1
templates/profile.html
+1
-1
No files found.
djangoapps/student/models.py
View file @
0e72884e
...
...
@@ -32,12 +32,12 @@ class UserProfile(models.Model):
def
get_meta
(
self
):
js_str
=
self
.
meta
if
not
js
:
js
=
dict
()
if
not
js
_str
:
js
_str
=
dict
()
else
:
js
=
json
.
re
ads
(
self
.
meta
)
js
_str
=
json
.
lo
ads
(
self
.
meta
)
return
js
return
js
_str
def
set_meta
(
self
,
js
):
self
.
meta
=
json
.
dumps
(
js
)
...
...
djangoapps/student/views.py
View file @
0e72884e
import
datetime
import
json
import
logging
import
random
...
...
@@ -16,6 +17,7 @@ from django.db import connection
from
django.http
import
HttpResponse
,
Http404
from
django.shortcuts
import
redirect
from
mitxmako.shortcuts
import
render_to_response
,
render_to_string
from
mako
import
exceptions
from
django_future.csrf
import
ensure_csrf_cookie
...
...
@@ -373,7 +375,7 @@ def confirm_email_change(request, key):
meta
=
up
.
get_meta
()
if
'old_emails'
not
in
meta
:
meta
[
'old_emails'
]
=
[]
meta
[
'old_emails'
]
.
append
(
user
.
email
)
meta
[
'old_emails'
]
.
append
(
[
user
.
email
,
datetime
.
datetime
.
now
()
.
isoformat
()]
)
up
.
set_meta
(
meta
)
up
.
save
()
user
.
email
=
pec
.
new_email
...
...
@@ -450,7 +452,7 @@ def accept_name_change(request):
meta
=
up
.
get_meta
()
if
'old_names'
not
in
meta
:
meta
[
'old_names'
]
=
[]
meta
[
'old_names'
]
.
append
(
up
.
name
)
meta
[
'old_names'
]
.
append
(
[
up
.
name
,
pnc
.
rationale
,
datetime
.
datetime
.
now
()
.
isoformat
()]
)
up
.
set_meta
(
meta
)
up
.
name
=
pnc
.
new_name
...
...
templates/emails/confirm_email_change.txt
View file @
0e72884e
...
...
@@ -3,7 +3,7 @@ from ${old_email} to ${new_email}. If you did not make this request,
please contact the course staff immediately. Contact information is
listed at:
https://${
sitename
}/t/mitx_help.html
https://${
site
}/t/mitx_help.html
We keep a log of old e-mails, so if this request was unintentional, we
can investigate.
templates/profile.html
View file @
0e72884e
...
...
@@ -109,7 +109,7 @@ $(function() {
if
(
data
.
success
){
$
(
"#apply_name_change"
).
html
(
"<h1>Your request has been submitted.</h1><p>We'll send you an e-mail if we approve the change or need further information. Please allow for up to a week for us to process your request.</p>"
);
}
else
{
$
(
"#
apply_name_chang
e_error"
).
html
(
data
.
error
);
$
(
"#
change_nam
e_error"
).
html
(
data
.
error
);
}
});
log_event
(
"profile"
,
{
"type"
:
"name_change_request"
,
...
...
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