diff --git a/seminar/views.py b/seminar/views.py index aefea9a5..5ceabcb8 100644 --- a/seminar/views.py +++ b/seminar/views.py @@ -752,6 +752,12 @@ def texDownloadView(request, rocnik, cislo): """View posílající JSON se zadanými a řešenými problémy pro založení čísla """ cislo = Cislo.objects.get(rocnik__rocnik=rocnik, cislo=cislo) + if cislo.faze == cislo.FAZE_NAHRANO: + # obsah byl nahrán z TeXu na web, už je příliš složitý + return JsonResponse( + {"error": "Obsah čísla už byl nahrán z TeXu na web."} + ) + zadane = Problem.objects.filter( cislo_zadani=cislo, stav=Problem.STAV_ZADANY @@ -788,4 +794,7 @@ def texDownloadView(request, rocnik, cislo): } for p in resene ], } + + cislo.faze = Cislo.FAZE_TEX + cislo.save() return JsonResponse(response)