Routeur: Ajout temporaire des modules workflow et dae en écriture
[auf_rh_dae.git] / src / auf.django.emploi / auf / django / emploi / views.py
CommitLineData
ab72a5f9
OL
1from django.core.urlresolvers import reverse
2from django.shortcuts import render_to_response, redirect
3from django.template import RequestContext, Context
4from auf.django.emploi import forms as emploiForms
5
6def postuler(request,):
7 if request.method == "POST":
8 form = emploiForms.PostulerOffreEmploiForm(request.POST)
9 piecesForm = emploiForms.CandidatPieceForm(request.POST, request.FILES)
10 if form.is_valid() and piecesForm.is_valid():
11 redirect(reverse('test_postuler'))
12
13 else:
14 form = emploiForms.PostulerOffreEmploiForm()
15 piecesForm = emploiForms.CandidatPieceForm(instance=form.instance)
16 c = {'form' : form, 'piecesForm': piecesForm, 'page_title': 'Offre emploi', }
17
18 return render_to_response('emploi/candidat_form.html', Context(c), RequestContext(request))