From c518fbc5af84b3ba00b3fa7161e053bbc7984da3 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Mon, 5 Feb 2024 21:27:04 +0000 Subject: [PATCH] more fix --- core/models/caves.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/models/caves.py b/core/models/caves.py index ec63911..84ce88e 100644 --- a/core/models/caves.py +++ b/core/models/caves.py @@ -742,5 +742,9 @@ def update_dataissue(parsercode, message): for s in issues: print(f" # {s.id=} DataIssues '{parsercode}' {message}") # .id is Django internal field, not one of ours message = "#2 " + message - issues[0].message = message - issues[0].save() \ No newline at end of file + if len(issues) > 0: + i = issues[0] + i.message = message + i.save() + else: + DataIssue.objects.create(parser=parsercode, message=message) \ No newline at end of file