Commit 0085a2ca by Pavel Yushchenko

fixes registration

parent 79a34072
...@@ -648,7 +648,7 @@ def create_account(request, post_override=None): ...@@ -648,7 +648,7 @@ def create_account(request, post_override=None):
for a in ['email', 'password', "lastname", "firstname", "middlename", "year_of_birth", for a in ['email', 'password', "lastname", "firstname", "middlename", "year_of_birth",
"level_of_education", "education_place", "education_year", "level_of_education", "education_place", "education_year",
"work_type", "work_number", "work_name", "work_login", "work_location", "work_type", "work_number", "work_name", "work_login", "work_location",
"work_occupation", "work_teaching_experience", "work_qualification_category", "work_qualification_category_year", "work_occupation", "work_occupation_other", "work_teaching_experience", "work_qualification_category", "work_qualification_category_year",
"contact_phone"]: "contact_phone"]:
if a not in post_vars: if a not in post_vars:
js['value'] = ugettext_lazy("Error (401 {field}). E-mail us.").format(field=a) js['value'] = ugettext_lazy("Error (401 {field}). E-mail us.").format(field=a)
...@@ -690,6 +690,11 @@ def create_account(request, post_override=None): ...@@ -690,6 +690,11 @@ def create_account(request, post_override=None):
js['field'] = "level_of_education" js['field'] = "level_of_education"
return HttpResponse(json.dumps(js, cls=LazyEncoder)) return HttpResponse(json.dumps(js, cls=LazyEncoder))
if post_vars["work_occupation"] == 'other' and "work_occupation2" in post_vars:
post_vars.post_vars["work_occupation"] = post_vars["work_occupation2"]
if post_vars["work_occupation_other"] == 'other' and "work_occupation_other2" in post_vars:
post_vars.post_vars["work_occupation_other"] = post_vars["work_occupation_other2"]
for a in required_post_vars: for a in required_post_vars:
if len(post_vars[a]) < 1: if len(post_vars[a]) < 1:
error_str = {'username': ugettext_lazy('Username must be minimum of two characters long.'), error_str = {'username': ugettext_lazy('Username must be minimum of two characters long.'),
......
...@@ -157,7 +157,7 @@ $(document).ready(function(){ ...@@ -157,7 +157,7 @@ $(document).ready(function(){
<option value="${code}">${_(wo_occ)}</option> <option value="${code}">${_(wo_occ)}</option>
%endfor %endfor
</select> </select>
<input id="work-occupation2" type="text" name="work_occupation" value="" style="display:none"/> <input id="work-occupation2" type="text" name="work_occupation2" value="" style="display:none"/>
</span> </span>
<span class="field select" id="field-work-occupation-other"> <span class="field select" id="field-work-occupation-other">
<label for="work-occupation-other">${_("Another occupation at educational institution")}</label> <label for="work-occupation-other">${_("Another occupation at educational institution")}</label>
...@@ -167,7 +167,7 @@ $(document).ready(function(){ ...@@ -167,7 +167,7 @@ $(document).ready(function(){
<option value="${code}">${_(wo_occ)}</option> <option value="${code}">${_(wo_occ)}</option>
%endfor %endfor
</select> </select>
<input id="work-occupation-other2" type="text" name="work_occupation_other" value="" style="display:none"/> <input id="work-occupation-other2" type="text" name="work_occupation_other2" value="" style="display:none"/>
</span> </span>
<span class="field required text" id="field-work-teaching-experience"> <span class="field required text" id="field-work-teaching-experience">
<label for="work-work_teaching_experience">${_('Educational experience at educational institution')}</label> <label for="work-work_teaching_experience">${_('Educational experience at educational institution')}</label>
......
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