diff --git a/OpenBench/utils.py b/OpenBench/utils.py index 3e15d76..1c90d0d 100644 --- a/OpenBench/utils.py +++ b/OpenBench/utils.py @@ -84,7 +84,11 @@ def getMachine(machineid, username, osname, threads): # Client has no saved machine ID, make a new machine if machineid == 'None': - return Machine.objects.create(owner=username, osname=osname, threads=int(threads)) + machine = Machine() + machine.username = username + machine.osname = osname + machine.threads = int(threads) + return machine # Fetch and verify the claimed machine ID machine = Machine.objects.get(id=machineid) @@ -94,6 +98,7 @@ 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 e123bd5..21069cd 100644 --- a/OpenBench/views.py +++ b/OpenBench/views.py @@ -374,9 +374,6 @@ 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)))