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
d22c0cd5
Commit
d22c0cd5
authored
Feb 12, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Legal name required, better error messages
parent
091a45dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
student/views.py
+8
-2
No files found.
student/views.py
View file @
d22c0cd5
...
...
@@ -136,9 +136,15 @@ def create_account(request, post_override=None):
# TODO: Confirm e-mail is not from a generic domain (mailinator, etc.)? Not sure if
# this is a good idea
# TODO: Check password is sane
for
a
in
[
'username'
,
'email'
,
'password'
,
'terms_of_service'
,
'honor_code'
]:
for
a
in
[
'username'
,
'email'
,
'
name'
,
'
password'
,
'terms_of_service'
,
'honor_code'
]:
if
len
(
post_vars
[
a
])
<
2
:
js
[
'value'
]
=
"{field} is required."
.
format
(
field
=
a
)
error_str
=
{
'username'
:
'Username of length 2 or greater'
,
'email'
:
'Properly formatted e-mail'
,
'name'
:
'Your legal name '
,
'password'
:
'Valid password '
,
'terms_of_service'
:
'Accepting Terms of Service'
,
'honor_code'
:
'Agreeing to the Honor Code'
}
js
[
'value'
]
=
"{field} is required."
.
format
(
field
=
error_str
[
a
])
return
HttpResponse
(
json
.
dumps
(
js
))
try
:
...
...
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