personnes: individual holidays creation fix

Closes #3108
This commit is contained in:
Serghei Mihai 2013-12-17 12:36:05 +01:00
parent 6fd0e5b8a4
commit a73d8a8246
No known key found for this signature in database
GPG Key ID: 76D1C964BF2FA1AF
1 changed files with 4 additions and 1 deletions

View File

@ -414,7 +414,10 @@ class HolidayCreateView(HolidayManagement, cbv.CreateView):
def form_valid(self, form):
try:
form.save()
holiday = form.save()
worker = models.Worker.objects.get(pk=self.kwargs['worker_pk'])
holiday.worker = worker
holiday.save()
messages.success(self.request, u'Absence ajoutée avec succès')
except Exception, e:
logger.debug('Error on creating a holiday: %s' % e)