Esempio n. 1
0
def questionnaire_post(request, applicant, pagenum, page):
    for q in page.questions:
        answer = request.POST.get(q.name)
        applicant.answers[q.name] = answer
    applicant.save(request)
    if pagenum == len(QUESTIONNAIRE):
        post = make_forum_post(applicant)
        mybb = MyBB()
        tid = mybb.get_tid(APPLICANT_FORUM, applicant.charinfo.characterName)
        mybb.create_post(APPLICANT_FORUM, "Application Form", applicant.charinfo.characterName, post, tid=tid)
        applicant.has_applied = True
        applicant.save(request)
        return HttpResponseRedirect("/recruitment/apply/")
    else:
        return HttpResponseRedirect("/recruitment/apply/%s/" % (pagenum + 1))