From 8d09fd5389dc92f5d9a0a00c585ba598b1facf8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Tue, 3 Dec 2024 19:10:36 +0100 Subject: [PATCH] =?UTF-8?q?Status=20opravy=20=C5=99e=C5=A1it=20p=C5=99es?= =?UTF-8?q?=20enum?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- korektury/templates/korektury/opraf.html | 16 ++++++++-------- korektury/views.py | 19 ++----------------- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/korektury/templates/korektury/opraf.html b/korektury/templates/korektury/opraf.html index ec550b36..3b327d69 100644 --- a/korektury/templates/korektury/opraf.html +++ b/korektury/templates/korektury/opraf.html @@ -132,23 +132,23 @@ {% endif %} - {% if o.status != 'k_oprave' %} - {% endif %} - {% if o.status != 'opraveno' %} - {% endif %} - {% if o.status != 'neni_chyba' %} - {% endif %} - {% if o.status != 'k_zaneseni' %} - {% endif %} diff --git a/korektury/views.py b/korektury/views.py index 861afac8..a89f9a79 100644 --- a/korektury/views.py +++ b/korektury/views.py @@ -94,25 +94,10 @@ class KorekturyView(generic.TemplateView): op.autor = autor op.text = text op.save() - elif (action == 'undone'): + elif action in Oprava.STATUS.values: id = int(q.get('id')) op = Oprava.objects.get(id=id) - op.status = op.STATUS.K_OPRAVE - op.save() - elif (action == 'done'): - id = int(q.get('id')) - op = Oprava.objects.get(id=id) - op.status = op.STATUS.OPRAVENO - op.save() - elif (action == 'ready'): - id = int(q.get('id')) - op = Oprava.objects.get(id=id) - op.status = op.STATUS.K_ZANESENI - op.save() - elif (action == 'wontfix'): - id = int(q.get('id')) - op = Oprava.objects.get(id=id) - op.status = op.STATUS.NENI_CHYBA + op.status = action op.save() elif (action == 'comment'): id = int(q.get('id'))