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
d7385ee9
Commit
d7385ee9
authored
Sep 13, 2013
by
David Adams
Committed by
Jason Bau
Sep 13, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed ordering of required fields on registration page to be more user friendly.
parent
e054f6df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
22 deletions
+23
-22
common/djangoapps/cme_registration/views.py
+23
-22
No files found.
common/djangoapps/cme_registration/views.py
View file @
d7385ee9
...
...
@@ -241,30 +241,31 @@ def validate_required_fields(post_vars):
"""
#Add additional required fields here
required_fields_
dict
=
{
'username'
:
'Username must be minimum of two characters long.'
,
'email'
:
'A properly formatted e-mail is required.'
,
'name'
:
'Your legal name must be a minimum of two characters long.'
,
'password'
:
'A valid password is required.'
,
'profession'
:
'Choose your profession.'
,
'license_number'
:
'Enter your license number.'
,
'patient_population'
:
'Choose your patient population'
,
'specialty'
:
'Choose your specialty'
,
'address_1'
:
'Enter your Address 01'
,
'city'
:
'Enter your city'
,
'state_province'
:
'Choose your state/Province'
,
'postal_code'
:
'Enter your postal code'
,
'country'
:
'Choose your country'
,
'phone_number'
:
'Enter your phone number'
,
'hear_about_us'
:
'Choose how you heard about us'
}
required_fields_
list
=
[{
'email'
:
'A properly formatted e-mail is required.'
}
,
{
'password'
:
'A valid password is required.'
}
,
{
'username'
:
'Username must be minimum of two characters long.'
}
,
{
'name'
:
'Your legal name must be a minimum of two characters long.'
}
,
{
'profession'
:
'Choose your profession.'
}
,
{
'license_number'
:
'Enter your license number.'
}
,
{
'patient_population'
:
'Choose your patient population'
}
,
{
'specialty'
:
'Choose your specialty'
}
,
{
'address_1'
:
'Enter your Address 01'
}
,
{
'city'
:
'Enter your city'
}
,
{
'state_province'
:
'Choose your state/Province'
}
,
{
'postal_code'
:
'Enter your postal code'
}
,
{
'country'
:
'Choose your country'
}
,
{
'phone_number'
:
'Enter your phone number'
}
,
{
'hear_about_us'
:
'Choose how you heard about us'
}
]
error
=
{}
for
k
,
val
in
required_fields_dict
.
items
():
if
len
(
post_vars
.
get
(
k
))
<
2
:
error
[
'success'
]
=
False
error
[
'value'
]
=
val
error
[
'field'
]
=
k
return
error
for
required_field
in
required_fields_list
:
for
key
,
val
in
required_field
.
iteritems
():
if
len
(
post_vars
.
get
(
key
))
<
2
:
error
[
'success'
]
=
False
error
[
'value'
]
=
val
error
[
'field'
]
=
key
return
error
def
validate_required_boxes
(
post_vars
):
...
...
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