Browse Source

Fix data narození v osobních údajích (prefill a ukládání)

middleware_test
Jonas Havelka 4 years ago
parent
commit
82627c2be3
  1. 3
      seminar/views/views_all.py

3
seminar/views/views_all.py

@ -1100,6 +1100,8 @@ def resitelEditView(request):
prefill_1.update(prefill_2) prefill_1.update(prefill_2)
prefill_3=model_to_dict(osoba_edit) prefill_3=model_to_dict(osoba_edit)
prefill_1.update(prefill_3) prefill_1.update(prefill_3)
if 'datum_narozeni' in prefill_1:
prefill_1['datum_narozeni'] = str(prefill_1['datum_narozeni'])
if resitel_edit and resitel_edit.rok_maturity < date.today().year: if resitel_edit and resitel_edit.rok_maturity < date.today().year:
form = ProfileEditFormPoMat(initial=prefill_1) form = ProfileEditFormPoMat(initial=prefill_1)
else: else:
@ -1121,6 +1123,7 @@ def resitelEditView(request):
osoba_edit.ulice = fcd['ulice'] osoba_edit.ulice = fcd['ulice']
osoba_edit.mesto = fcd['mesto'] osoba_edit.mesto = fcd['mesto']
osoba_edit.psc = fcd['psc'] osoba_edit.psc = fcd['psc']
osoba_edit.datum_narozeni = fcd['datum_narozeni']
## Změny v osobě s podmínkami ## Změny v osobě s podmínkami
if fcd.get('spam',False): if fcd.get('spam',False):
osoba_edit.datum_souhlasu_zasilani = date.today() osoba_edit.datum_souhlasu_zasilani = date.today()

Loading…
Cancel
Save