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