Skip to content

Commit

Permalink
Get promotions after and loop
Browse files Browse the repository at this point in the history
  • Loading branch information
cal4 committed Aug 20, 2024
1 parent b8f2b65 commit 750fa7a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/morePromotions.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,16 @@ 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
logging.error("[MORE PROMOS] Error More Promotions", exc_info=True)
# 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")

0 comments on commit 750fa7a

Please sign in to comment.