Commit 55ee3110 by yushchenko

add check for numeric fields

parent 693e661d
......@@ -711,6 +711,14 @@ def create_account(request, post_override=None):
js['field'] = a
return HttpResponse(json.dumps(js))
numeric_post_vars = ["education_year","work_managing_experience","work_teaching_experience", "work_qualification_category_year", "contact_phone"]
for a in numeric_post_vars:
if len(post_vars[a]) > 0 and not post_vars[a].isdigit():
js['value'] = _("Field must be numeric")
js['field'] = a
return HttpResponse(json.dumps(js))
try:
validate_email(post_vars['email'])
except ValidationError:
......
......@@ -21,7 +21,7 @@ def url_class(is_active):
% for tab in get_course_tabs(user, course, active_page):
<li>
<a href="${tab.link | h}" class="${url_class(tab.is_active)}">
${_(tab.name | h)}
${_(tab.name) | h}
% if tab.is_active == True:
<span class="sr">, current location</span>
%endif
......
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