summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2020-06-16 19:22:22 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2020-06-16 19:22:22 (GMT)
commit15421284235129d77737a49f5227ed3f773e21ab (patch)
tree7ecd8eabd7124d03e2d9e5cc6115c13733e32323
parent2092e81b6b9a27f59377126446a07f6d3691907c (diff)
downloadscrutiny-master.zip
scrutiny-master.tar.gz
scrutiny-master.tar.bz2
ignore duplicated version objectsHEADmaster
-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)