From b59b9828b51ce07e3b1bb1b2c79c9a84f8fa8915 Mon Sep 17 00:00:00 2001 From: Ross Date: Sat, 4 Dec 2021 18:17:52 +0000 Subject: [PATCH] . --- atlas/templates/atlas/series_viewer.html | 2 +- atlas/views.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/atlas/templates/atlas/series_viewer.html b/atlas/templates/atlas/series_viewer.html index e1376da6..b72332f7 100755 --- a/atlas/templates/atlas/series_viewer.html +++ b/atlas/templates/atlas/series_viewer.html @@ -90,7 +90,7 @@ This series is not associated with any cases. $("#hidden-form").hide() }); - {% if editing_finding %} + {% if editing_finding > 0 %} $("#hidden-form").show() {% endif %} diff --git a/atlas/views.py b/atlas/views.py index d5c0a499..e1c0ae1d 100755 --- a/atlas/views.py +++ b/atlas/views.py @@ -119,7 +119,7 @@ def case_detail(request, pk): def series_detail(request, pk, finding_pk=None): series = get_object_or_404(Series, pk=pk) - editing_finding = False + editing_finding = -1 if finding_pk is not None: finding = get_object_or_404(SeriesFinding, pk=finding_pk) series_finding_form = SeriesFindingForm(None, instance=finding) @@ -566,19 +566,19 @@ def create_series_findings(request): findings = Finding.objects.filter(pk__in=findings_ids) structures = Structure.objects.filter(pk__in=structure_ids) - if series_finding_id == "False": + if series_finding_id > 0: + sf = get_object_or_404(SeriesFinding, pk=series_finding_id) + sf.series = series + sf.description=description + sf.annotation_json=annotation_json + sf.viewport_json=viewport_json + else: sf = SeriesFinding.objects.create( series=series, description=description, annotation_json=annotation_json, viewport_json=viewport_json, ) - else: - sf = get_object_or_404(SeriesFinding, pk=series_finding_id) - sf.series = series - sf.description=description - sf.annotation_json=annotation_json - sf.viewport_json=viewport_json sf.findings.set(findings)