Commit d7385ee9 by David Adams Committed by Jason Bau

Fixed ordering of required fields on registration page to be more user friendly.

parent e054f6df
...@@ -241,30 +241,31 @@ def validate_required_fields(post_vars): ...@@ -241,30 +241,31 @@ def validate_required_fields(post_vars):
""" """
#Add additional required fields here #Add additional required fields here
required_fields_dict = {'username': 'Username must be minimum of two characters long.', required_fields_list = [{'email': 'A properly formatted e-mail is required.'},
'email': 'A properly formatted e-mail is required.', {'password': 'A valid password is required.'},
'name': 'Your legal name must be a minimum of two characters long.', {'username': 'Username must be minimum of two characters long.'},
'password': 'A valid password is required.', {'name': 'Your legal name must be a minimum of two characters long.'},
'profession': 'Choose your profession.', {'profession': 'Choose your profession.'},
'license_number': 'Enter your license number.', {'license_number': 'Enter your license number.'},
'patient_population': 'Choose your patient population', {'patient_population': 'Choose your patient population'},
'specialty': 'Choose your specialty', {'specialty': 'Choose your specialty'},
'address_1': 'Enter your Address 01', {'address_1': 'Enter your Address 01'},
'city': 'Enter your city', {'city': 'Enter your city'},
'state_province': 'Choose your state/Province', {'state_province': 'Choose your state/Province'},
'postal_code': 'Enter your postal code', {'postal_code': 'Enter your postal code'},
'country': 'Choose your country', {'country': 'Choose your country'},
'phone_number': 'Enter your phone number', {'phone_number': 'Enter your phone number'},
'hear_about_us': 'Choose how you heard about us' {'hear_about_us': 'Choose how you heard about us'}
} ]
error = {} error = {}
for k, val in required_fields_dict.items(): for required_field in required_fields_list:
if len(post_vars.get(k)) < 2: for key, val in required_field.iteritems():
error['success'] = False if len(post_vars.get(key)) < 2:
error['value'] = val error['success'] = False
error['field'] = k error['value'] = val
return error error['field'] = key
return error
def validate_required_boxes(post_vars): def validate_required_boxes(post_vars):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment