Fix disabled
This commit is contained in:
parent
e68a371388
commit
d28e0def8d
2 changed files with 6 additions and 3 deletions
|
@ -146,7 +146,7 @@ class PrihlaskaForm(forms.Form):
|
||||||
class ProfileEditForm(forms.Form):
|
class ProfileEditForm(forms.Form):
|
||||||
username = forms.CharField(label='Přihlašovací jméno',
|
username = forms.CharField(label='Přihlašovací jméno',
|
||||||
max_length=256,
|
max_length=256,
|
||||||
required=True,
|
required=False,
|
||||||
disabled=True)
|
disabled=True)
|
||||||
|
|
||||||
jmeno = forms.CharField(label='Jméno', max_length=256, required=True)
|
jmeno = forms.CharField(label='Jméno', max_length=256, required=True)
|
||||||
|
|
|
@ -1125,10 +1125,13 @@ def resitelEditView(request):
|
||||||
form = ProfileEditForm(initial=prefill_1)
|
form = ProfileEditForm(initial=prefill_1)
|
||||||
## Změna údajů a jejich uložení
|
## Změna údajů a jejich uložení
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
|
POST = request.POST.copy()
|
||||||
|
POST["username"] = osoba_edit.user.username
|
||||||
|
|
||||||
if 'rok_maturity' not in prefill_1 or prefill_1['rok_maturity'] < date.today().year:
|
if 'rok_maturity' not in prefill_1 or prefill_1['rok_maturity'] < date.today().year:
|
||||||
form = PoMaturiteProfileEditForm(request.POST)
|
form = PoMaturiteProfileEditForm(POST)
|
||||||
else:
|
else:
|
||||||
form = ProfileEditForm(request.POST)
|
form = ProfileEditForm(POST)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
## Změny v osobě
|
## Změny v osobě
|
||||||
fcd = form.cleaned_data
|
fcd = form.cleaned_data
|
||||||
|
|
Loading…
Reference in a new issue