X-Git-Url: http://git.auf.org/?p=auf_rh_dae.git;a=blobdiff_plain;f=project%2Fdae%2Fforms.py;h=2d1f2922ce1373e0247cc30878348cb5a8813eb3;hp=215c809b6c7d31d14a5fc9128049b280a74dc6fb;hb=494ff2be7c36ce28f6e2aa2ad2105bbeaeea1fde;hpb=703e5cfbed39643ac5f262cecf3c8ebc44619bce diff --git a/project/dae/forms.py b/project/dae/forms.py index 215c809..2d1f292 100644 --- a/project/dae/forms.py +++ b/project/dae/forms.py @@ -59,6 +59,15 @@ class PosteForm(forms.ModelForm): [('rh-%s' % p.id, unicode(p)) for p in rhv1], key=lambda t: t[1]) + def save(self, *args, **kwargs): + kwargs2 = kwargs.copy() + kwargs2['commit'] = False + poste = super(PosteForm, self).save(*args, **kwargs2) + # id_rh + if 'commit' not in kwargs or kwargs['commit']: + poste.save() + return poste + class PosteFinancementForm(forms.ModelForm): """ Formulaire des sources de financement pour un poste. """