From 12cf174f8b547d3ef5892cb73d74ba69a53f6ba3 Mon Sep 17 00:00:00 2001 From: Jonas Havelka Date: Tue, 4 May 2021 19:42:05 +0200 Subject: [PATCH] Revert "PoMat -> PoMaturite" This reverts commit 19a566d6 --- seminar/forms.py | 2 +- seminar/templates/seminar/profil/edit.html | 2 +- seminar/views/views_all.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/seminar/forms.py b/seminar/forms.py index 7aaa78b4..4db77c18 100644 --- a/seminar/forms.py +++ b/seminar/forms.py @@ -143,7 +143,7 @@ class PrihlaskaForm(forms.Form): self.add_error('skola_adresa',forms.ValidationError('Je nutné vyplnit adresu školy')) # Editační formulář bez řešitele. -class ProfileEditFormPoMaturite(forms.Form): +class ProfileEditFormPoMat(forms.Form): username = forms.CharField(label='Přihlašovací jméno', max_length=256, required=True) diff --git a/seminar/templates/seminar/profil/edit.html b/seminar/templates/seminar/profil/edit.html index a5aacd0e..89ad6b8c 100644 --- a/seminar/templates/seminar/profil/edit.html +++ b/seminar/templates/seminar/profil/edit.html @@ -61,7 +61,7 @@ {% include "seminar/profil/prihlaska_field.html" with field=form.stat_text id="id_li_stat_text"%} -{% if not po_maturite %} {# Vysloužilým účastníkům skrýt editaci školy apod. #} +{% if not PoMat %} {# Vysloužilým účastníkům skrýt editaci školy apod. #}

diff --git a/seminar/views/views_all.py b/seminar/views/views_all.py index 461eca80..3cfbd21d 100644 --- a/seminar/views/views_all.py +++ b/seminar/views/views_all.py @@ -26,7 +26,7 @@ import seminar.models as m from seminar.models import Problem, Cislo, Reseni, Nastaveni, Rocnik, Soustredeni, Organizator, Resitel, Novinky, Soustredeni_Ucastnici, Pohadka, Tema, Clanek, Osoba, Skola # Tohle je stare a chceme se toho zbavit. Pouzivejte s.ToCoChci #from .models import VysledkyZaCislo, VysledkyKCisluZaRocnik, VysledkyKCisluOdjakziva from seminar import utils, treelib -from seminar.forms import PrihlaskaForm, LoginForm, ProfileEditForm, ProfileEditFormPoMaturite +from seminar.forms import PrihlaskaForm, LoginForm, ProfileEditForm, ProfileEditFormPoMat import seminar.forms as f import seminar.templatetags.treenodes as tnltt import seminar.views.views_rest as vr @@ -1103,13 +1103,13 @@ def resitelEditView(request): 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: - form = ProfileEditFormPoMaturite(initial=prefill_1) + form = ProfileEditFormPoMat(initial=prefill_1) else: form = ProfileEditForm(initial=prefill_1) ## Změna údajů a jejich uložení if request.method == 'POST': if resitel_edit and resitel_edit.rok_maturity < date.today().year: - form = ProfileEditFormPoMaturite(request.POST) + form = ProfileEditFormPoMat(request.POST) else: form = ProfileEditForm(request.POST) if form.is_valid(): @@ -1149,7 +1149,7 @@ def resitelEditView(request): return formularOKView(request) else: ## Stránka před odeslaním formuláře = předvyplněný formulář - return render(request, 'seminar/profil/edit.html', {'form': form, 'po_maturite': resitel_edit and resitel_edit.rok_maturity < date.today().year}) + return render(request, 'seminar/profil/edit.html', {'form': form, 'PoMat': resitel_edit and resitel_edit.rok_maturity < date.today().year}) def prihlaskaView(request): generic_logger = logging.getLogger('seminar.prihlaska')