From 590ade59c68727add399b9e2d9cf93ed2374e60b Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 24 Sep 2021 22:22:39 +0100 Subject: [PATCH] not saving pb if test was bailed out --- backend/api/controllers/result.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/api/controllers/result.js b/backend/api/controllers/result.js index a1a5883f3..0ac77c0d1 100644 --- a/backend/api/controllers/result.js +++ b/backend/api/controllers/result.js @@ -220,8 +220,13 @@ class ResultController { // } - const isPb = await UserDAO.checkIfPb(uid, result); - const tagPbs = await UserDAO.checkIfTagPb(uid, result); + let isPb = false; + let tagPbs = []; + + if (!result.bailedOut) { + isPb = await UserDAO.checkIfPb(uid, result); + tagPbs = await UserDAO.checkIfTagPb(uid, result); + } if (isPb) { result.isPb = true;