From 917a88c6f43c5549c6ddc036ad738f3f17c8a459 Mon Sep 17 00:00:00 2001 From: Lavissa Date: Sun, 21 Jan 2024 20:56:08 +0100 Subject: [PATCH] Add check for KeyError on reading plugin commit (#6300) * Add check for KeyError on reading plugin commit * . * . --- InvenTree/part/fixtures/part.yaml | 1 + InvenTree/plugin/helpers.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/InvenTree/part/fixtures/part.yaml b/InvenTree/part/fixtures/part.yaml index f50a48c42d..5acba3e4c5 100644 --- a/InvenTree/part/fixtures/part.yaml +++ b/InvenTree/part/fixtures/part.yaml @@ -181,6 +181,7 @@ name: 'Green chair' description: 'A template chair part which is green' variant_of: 10000 + is_template: true category: 7 trackable: true creation_date: '2030-01-01' diff --git a/InvenTree/plugin/helpers.py b/InvenTree/plugin/helpers.py index 211641514a..1352c0ac65 100644 --- a/InvenTree/plugin/helpers.py +++ b/InvenTree/plugin/helpers.py @@ -145,6 +145,8 @@ def get_git_log(path): datetime.datetime.fromtimestamp(commit.author_time).isoformat(), commit.message.decode().split('\n')[0], ] + except KeyError as err: + logger.debug('No HEAD tag found in git repo at path %s', path) except NotGitRepository: pass