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
45ed4a41
Commit
45ed4a41
authored
Dec 21, 2012
by
Brian Talbot
Browse files
Options
Browse Files
Download
Plain Diff
resolving merge conflict around test_center_register.html template
parents
3bd8f408
2788ad86
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
34 deletions
+25
-34
common/djangoapps/student/views.py
+19
-21
lms/templates/test_center_register.html
+6
-13
No files found.
common/djangoapps/student/views.py
View file @
45ed4a41
...
...
@@ -675,13 +675,18 @@ def _do_create_or_update_test_center_user(post_vars):
try
:
testcenter_user
.
save
()
except
IntegrityError
,
ie
:
message
=
"
%
s"
%
ie
context
=
{
'course'
:
course
,
'user'
:
user
,
'message'
:
message
,
'testcenteruser'
:
testcenter_user
,
}
return
render_to_response
(
'test_center_register.html'
,
context
)
js
=
{
'success'
:
False
}
error_msg
=
unicode
(
ie
);
# attempt to find a field name to signal
for
fieldname
in
TestCenterUser
.
user_provided_fields
():
if
error_msg
.
find
(
fieldname
)
>=
0
:
js
[
'value'
]
=
error_msg
js
[
'field'
]
=
fieldname
return
HttpResponse
(
json
.
dumps
(
js
))
# otherwise just return the error message
js
[
'value'
]
=
error_msg
js
[
'field'
]
=
"General Error"
return
HttpResponse
(
json
.
dumps
(
js
))
# create and save the registration:
needs_saving
=
False
...
...
@@ -715,13 +720,7 @@ def _do_create_or_update_test_center_user(post_vars):
try
:
registration
.
save
()
except
IntegrityError
,
ie
:
message
=
"
%
s"
%
ie
context
=
{
'course'
:
course
,
'user'
:
user
,
'message'
:
message
,
'testcenteruser'
:
testcenter_user
,
}
return
render_to_response
(
'test_center_register.html'
,
context
)
raise
return
(
user
,
testcenter_user
,
registration
)
...
...
@@ -743,14 +742,14 @@ def create_test_registration(request, post_override=None):
js
[
'field'
]
=
a
return
HttpResponse
(
json
.
dumps
(
js
))
# Confirm appropriate fields are
there.
# Confirm appropriate fields are
filled in with something for now
for
a
in
[
'first_name'
,
'last_name'
,
'address_1'
,
'city'
,
'country'
]:
if
len
(
post_vars
[
a
])
<
2
:
error_str
=
{
'first_name'
:
'First name must be minimum of two characters long.'
,
'last_name'
:
'Last name must be minimum of two characters long.'
,
'address_1'
:
'
Last name
must be minimum of two characters long.'
,
'city'
:
'
Last name
must be minimum of two characters long.'
,
'country'
:
'
Last name
must be minimum of two characters long.'
,
'address_1'
:
'
Address
must be minimum of two characters long.'
,
'city'
:
'
City
must be minimum of two characters long.'
,
'country'
:
'
Country
must be minimum of two characters long.'
,
}
js
[
'value'
]
=
error_str
[
a
]
js
[
'field'
]
=
a
...
...
@@ -789,9 +788,8 @@ def create_test_registration(request, post_override=None):
# TODO: enable appropriate stat
# statsd.increment("common.student.account_created")
# js = {'success': True}
# return HttpResponse(json.dumps(js), mimetype="application/json")
return
HttpResponseRedirect
(
reverse
(
'dashboard'
))
js
=
{
'success'
:
True
}
return
HttpResponse
(
json
.
dumps
(
js
),
mimetype
=
"application/json"
)
def
get_random_post_override
():
"""
...
...
lms/templates/test_center_register.html
View file @
45ed4a41
...
...
@@ -15,19 +15,13 @@
<script
type=
"text/javascript"
>
(
function
()
{
$
(
".unenroll"
).
click
(
function
(
event
)
{
$
(
"#unenroll_course_id"
).
val
(
$
(
event
.
target
).
data
(
"course-id"
)
);
$
(
"#unenroll_course_number"
).
text
(
$
(
event
.
target
).
data
(
"course-number"
)
);
});
$
(
document
).
delegate
(
'#unenroll_form'
,
'ajax:success'
,
function
(
data
,
json
,
xhr
)
{
$
(
document
).
on
(
'ajax:success'
,
'#test_register_form'
,
function
(
data
,
json
,
xhr
)
{
if
(
json
.
success
)
{
location
.
href
=
"${reverse('dashboard')}"
;
}
else
{
if
(
$
(
'#unenroll_error'
).
length
==
0
)
{
$
(
'#unenroll_form'
).
prepend
(
'<div id="unenroll_error" class="modal-form-error"></div>'
);
}
$
(
'#unenroll_error'
).
text
(
json
.
error
).
stop
().
css
(
"display"
,
"block"
);
$
(
".field.error"
).
removeClass
(
'error'
);
$
(
'#register_error'
).
html
(
json
.
value
).
stop
().
css
(
"display"
,
"block"
);
$
(
"[data-field='"
+
json
.
field
+
"']"
).
addClass
(
'field-error'
)
}
});
...
...
@@ -147,7 +141,6 @@ exam_info = course.testcenter_info
</div>
<!-- NOTE: BT - registration error message -->
<!-- provide mechanism for error messages to appear -->
% if message:
<div
class=
"message message-status submission-error"
>
<p
class=
"message-copy"
>
${message}
</p>
...
...
@@ -327,7 +320,7 @@ exam_info = course.testcenter_info
if
registration
.
upload_status =
=
'
Accepted
'
:
regstatus =
"Registration approved by Pearson"
elif
registration
.
upload_status =
=
'
Error
'
:
regstatus =
"
rR
gistration rejected by Pearson: %s"
%
registration
.
upload_error_message
regstatus =
"
Re
gistration rejected by Pearson: %s"
%
registration
.
upload_error_message
elif
len
(
registration
.
accommodation_request
)
>
0 and registration.accommodation_code == '':
regstatus = "Pending approval of accommodation request"
%>
...
...
@@ -365,7 +358,7 @@ exam_info = course.testcenter_info
% endif
</p>
</div>
<div
class=
"details details-registration"
>
<!-- NOTE: showing test details -->
<h4>
Pearson VUE Test Details
</h4>
...
...
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