diff --git a/flashcards/models.py b/flashcards/models.py index f5ecaa4..b5cd1a7 100644 --- a/flashcards/models.py +++ b/flashcards/models.py @@ -99,6 +99,8 @@ class User(AbstractUser, SimpleEmailConfirmationUserMixin): "noreply@flashy.cards", [self.email]) def notify(self): + if self.registration_id is None: + raise ValueError("user's registration_id is null") gcm_ctx = gcm.GCM(GCM_API_KEY) try: gcm_ctx.plaintext_request(