Fix přijímání prázdné množiny tagů
This commit is contained in:
parent
283320b161
commit
9a6b66f7d9
1 changed files with 5 additions and 2 deletions
|
@ -89,7 +89,6 @@ def opravy_a_komentare_view(request, pdf_id: int, **kwargs):
|
||||||
if oprava_id != -1:
|
if oprava_id != -1:
|
||||||
oprava = get_object_or_404(Oprava, id=oprava_id)
|
oprava = get_object_or_404(Oprava, id=oprava_id)
|
||||||
else:
|
else:
|
||||||
tagy = list(map(int, q.get('tagy').split(",")))
|
|
||||||
pdf = get_object_or_404(KorekturovanePDF, id=pdf_id)
|
pdf = get_object_or_404(KorekturovanePDF, id=pdf_id)
|
||||||
oprava = Oprava.objects.create(
|
oprava = Oprava.objects.create(
|
||||||
pdf=pdf,
|
pdf=pdf,
|
||||||
|
@ -97,7 +96,11 @@ def opravy_a_komentare_view(request, pdf_id: int, **kwargs):
|
||||||
x=x,
|
x=x,
|
||||||
y=y,
|
y=y,
|
||||||
)
|
)
|
||||||
oprava.tagy.add(*KorekturaTag.objects.filter(id__in=tagy))
|
|
||||||
|
tagy_raw = q.get('tagy')
|
||||||
|
if tagy_raw != "":
|
||||||
|
tagy = list(map(int, tagy_raw.split(",")))
|
||||||
|
oprava.tagy.add(*KorekturaTag.objects.filter(id__in=tagy))
|
||||||
Komentar.objects.create(oprava=oprava, autor=autor, text=text)
|
Komentar.objects.create(oprava=oprava, autor=autor, text=text)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue