From 07049b5bdb15ba5588b8cdab3c1fdfcb429260f3 Mon Sep 17 00:00:00 2001 From: AndyGrant Date: Tue, 12 Jun 2018 23:20:00 -0400 Subject: [PATCH] Cannot use .get() for some reason unknown to me --- Client/OpenBench.py | 1 + OpenBench/utils.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Client/OpenBench.py b/Client/OpenBench.py index 792e490..6d4c0cb 100644 --- a/Client/OpenBench.py +++ b/Client/OpenBench.py @@ -296,6 +296,7 @@ def reportResults(data, wins, losses, draws, crashes, timeloss): 'timeloss' : timeloss, 'username' : USERNAME, 'password' : PASSWORD, + 'profileid' : data['profile']['id'], 'machineid' : data['machine']['id'], 'resultid' : data['result']['id'], 'testid' : data['test']['id']} diff --git a/OpenBench/utils.py b/OpenBench/utils.py index 6b92429..2f6520c 100644 --- a/OpenBench/utils.py +++ b/OpenBench/utils.py @@ -169,6 +169,7 @@ def workloadDictionary(machine, result, test): # specification for both engines. Group the dev and base # options with the coressponding engine, for easy usage return { + 'profile' : { 'id' : profile.id }, 'machine' : { 'id' : machine.id, }, 'result' : { 'id' : result.id, }, 'test' : { @@ -213,6 +214,7 @@ def update(request): games = wins + losses + draws # Parse the various IDs sent back + profileid = int(request.POST['profileid']) machineid = int(request.POST['machineid']) resultid = int(request.POST['resultid']) testid = int(request.POST['testid']) @@ -230,7 +232,7 @@ def update(request): finished = passed or failed # Update total # of games played for the User - Profile.objects.filter(user=user).update(games=F('games') + games) + Profile.objects.filter(id=profileid).update(games=F('games') + games) # Just force an update to Machine.update Machine.objects.filter(id=machineid).update()