From 88ce2145f418ce45d483e8ec21173b20c14eb015 Mon Sep 17 00:00:00 2001 From: AndyGrant Date: Tue, 12 Jun 2018 21:17:15 -0400 Subject: [PATCH] Fix bug which duplicates machines when no tests exist during registration --- OpenBench/utils.py | 1 - OpenBench/views.py | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenBench/utils.py b/OpenBench/utils.py index 7eaa0ed..3e15d76 100644 --- a/OpenBench/utils.py +++ b/OpenBench/utils.py @@ -94,7 +94,6 @@ def getMachine(machineid, username, osname, threads): # Update to reflect new worload machine.threads = int(threads) machine.mnps = 0.00 - machine.save() return machine def getWorkload(machine): diff --git a/OpenBench/views.py b/OpenBench/views.py index 21069cd..e123bd5 100644 --- a/OpenBench/views.py +++ b/OpenBench/views.py @@ -374,6 +374,9 @@ def getWorkload(request): try: result = OpenBench.utils.getResult(machine, test) except: return HttpResponse('None') + # Got everything + machine.save(); + # Send ID's and test information as a string dictionary return HttpResponse(str(OpenBench.utils.workloadDictionary(machine, result, test)))