Commit 55ee3110 by yushchenko

add check for numeric fields

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