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
d22c0cd5
Commit
d22c0cd5
authored
13 years ago
by
Piotr Mitros
Browse files
Options
Downloads
Patches
Plain Diff
Legal name required, better error messages
parent
091a45dc
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
student/views.py
+8
-2
8 additions, 2 deletions
student/views.py
with
8 additions
and
2 deletions
student/views.py
+
8
−
2
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
:
...
...
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