summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scrutiny/projects/management/commands/scrutinise.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/scrutiny/projects/management/commands/scrutinise.py b/scrutiny/projects/management/commands/scrutinise.py
index 4097170..5ee3c21 100644
--- a/scrutiny/projects/management/commands/scrutinise.py
+++ b/scrutiny/projects/management/commands/scrutinise.py
@@ -39,7 +39,11 @@ class Command(BaseCommand):
module.save()
seen_modules.add(module)
- version, created = Version.objects.get_or_create(module=module, version=version_string)
+ try:
+ version, created = Version.objects.get_or_create(module=module, version=version_string)
+ except Version.MultipleObjectsReturned:
+ # a race condition occured earlier, gently ignore
+ version = Version.objects.filter(module=module, version=version_string).first()
try:
installed_version = InstalledVersion.objects.get(service=service, version=version)