From 750fa7aeb5e6188869083a3b90397b40839ea110 Mon Sep 17 00:00:00 2001 From: Cal Williams <9409256+cal4@users.noreply.github.com> Date: Mon, 19 Aug 2024 23:06:13 -0400 Subject: [PATCH] Get promotions after and loop --- src/morePromotions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/morePromotions.py b/src/morePromotions.py index 588bfb4c..a1986a62 100644 --- a/src/morePromotions.py +++ b/src/morePromotions.py @@ -108,8 +108,6 @@ def completeMorePromotions(self): self.browser.webdriver.execute_script("window.scrollTo(0, 1080)") time.sleep(random.randint(5, 10)) - if promotion["pointProgress"] < promotion["pointProgressMax"]: - incompletePromotions.append((promotionTitle, promotion["promotionType"])) self.browser.utils.resetTabs() time.sleep(2) except Exception: # pylint: disable=broad-except @@ -117,6 +115,9 @@ def completeMorePromotions(self): # Reset tabs in case of an exception self.browser.utils.resetTabs() continue + for promotion in self.browser.utils.getDashboardData()["morePromotions"]: # Have to refresh + if promotion["pointProgress"] < promotion["pointProgressMax"]: + incompletePromotions.append((promotion["title"], promotion["promotionType"])) if incompletePromotions: Utils.sendNotification("Incomplete promotions(s)", incompletePromotions) logging.info("[MORE PROMOS] Exiting")