From 510909352c4f96b178e168a044052959574bd79b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Koci=C3=A1n?= Date: Sun, 29 Oct 2017 10:32:55 +0100 Subject: [PATCH] =?UTF-8?q?tex-upload:=20nahr=C3=A1v=C3=A1n=C3=AD=20zad?= =?UTF-8?q?=C3=A1n=C3=AD=20t=C3=A9mat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/seminar/views.py b/seminar/views.py index b7cc136b..7a5e9f41 100644 --- a/seminar/views.py +++ b/seminar/views.py @@ -786,7 +786,7 @@ def texUploadView(request): meta = json.loads(q["meta"]) html = q["html"] - if meta["typ"] in ["uloha", "serial", "reseni"]: + if meta["typ"] in ["uloha", "serial", "reseni", "tema"]: # Uložíme soubory if meta["typ"] != "reseni": @@ -801,6 +801,7 @@ def texUploadView(request): "uloha": Problem.TYP_ULOHA, "serial": Problem.TYP_SERIAL, "reseni": Problem.TYP_ULOHA, + "tema": Problem.TYP_TEMA, } problem_typ = typy[meta["typ"]] @@ -852,7 +853,8 @@ def texUploadView(request): else: problem.text_zadani = html problem.nazev = meta["nazev"] - problem.body = meta["body"] + if meta["typ"] != "tema": + problem.body = meta["body"] problem.save() cislo.faze = cislo.FAZE_NAHRANO