From d43d135123d0ed7a1e1ee8a0d7bc0f7faa3d37e0 Mon Sep 17 00:00:00 2001 From: rizwanisready Date: Tue, 4 Jun 2024 15:01:20 +0530 Subject: [PATCH] corrected code --- goodtimes/webhook.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/goodtimes/webhook.py b/goodtimes/webhook.py index df5703d..4a5a52f 100644 --- a/goodtimes/webhook.py +++ b/goodtimes/webhook.py @@ -64,6 +64,9 @@ class NotificationService: def referral_received_notification(self, principal, amount, email): print("referral_received_notification: ", principal.player_id) + if not self.should_send_referral_notification(principal): + print("Referral notifications are disabled for this user") + return title = "Congratulations! You got a referral G-Token." message = f"Your referral {email} has subscribed to GoodTimesApp. You have received {amount} (£)" self.send_notification(title, message, principal.player_id) @@ -71,9 +74,6 @@ class NotificationService: def payment_failed_notification(self, principal, subscription, amount): print("payment_failed_notification: ", principal.player_id) - if not self.should_send_referral_notification(principal): - print("Referral notifications are disabled for this user") - return title = "Payment Failed!" message = f"Your payment for {subscription} of ${amount} was failed." self.send_notification(title, message, principal.player_id)