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)