From c11ca225488dce2b5ac52235168ce20815e29555 Mon Sep 17 00:00:00 2001 From: "Tomas \"Jethro\" Pokorny" Date: Wed, 20 May 2020 21:44:12 +0200 Subject: [PATCH] seminar | submitovatko | prejmenovana trida, odebrany nadbytecne polozky formulare --- seminar/forms.py | 2 ++ seminar/urls.py | 2 +- seminar/views/views_all.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/seminar/forms.py b/seminar/forms.py index fb313272..24a2109c 100644 --- a/seminar/forms.py +++ b/seminar/forms.py @@ -257,6 +257,7 @@ class NahrajReseniForm(forms.ModelForm): class Meta: model = m.Reseni fields = ('problem',) + help_texts = {'problem':''} # Nezobrazovat help text ve formuláři widgets = {'problem': autocomplete.ModelSelect2Multiple( @@ -272,6 +273,7 @@ ReseniSPrilohamiFormSet = inlineformset_factory(m.Reseni,m.PrilohaReseni, fields = ('soubor','res_poznamka'), widgets = {'res_poznamka':forms.TextInput()}, extra = 1, + can_delete = False, ) diff --git a/seminar/urls.py b/seminar/urls.py index 1bbcf19c..79a98d03 100644 --- a/seminar/urls.py +++ b/seminar/urls.py @@ -118,7 +118,7 @@ urlpatterns = [ path('autocomplete/problem/odevzdatelny',views.OdevzdatelnyProblemAutocomplete.as_view(), name='autocomplete_problem_odevzdatelny'), path('temp/add_solution', views.AddSolutionView.as_view(),name='seminar_vloz_reseni'), - path('temp/submit_solution', views.SubmitSolutionView.as_view(),name='seminar_nahraj_reseni'), + path('temp/nahraj_reseni', views.NahrajReseniView.as_view(),name='seminar_nahraj_reseni'), path('', views.TitulniStranaView.as_view(), name='titulni_strana'), diff --git a/seminar/views/views_all.py b/seminar/views/views_all.py index c724a07c..c3d6cb22 100644 --- a/seminar/views/views_all.py +++ b/seminar/views/views_all.py @@ -1212,7 +1212,7 @@ class AddSolutionView(LoginRequiredMixin, FormView): form_class = f.VlozReseniForm success_url = '/' -class SubmitSolutionView(LoginRequiredMixin, CreateView): +class NahrajReseniView(LoginRequiredMixin, CreateView): model = s.Reseni template_name = 'seminar/nahraj_reseni.html' form_class = f.NahrajReseniForm