Commit f8b134f0a99d1bc0d45c4324f44a950f3ea46368

Authored by Rohan Rangray
1 parent d01dc2e822
Exists in master

Noisly fail notify() if the user's registration_id is null

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

flashcards/models.py View file @ f8b134f
... ... @@ -99,6 +99,8 @@
99 99 "noreply@flashy.cards", [self.email])
100 100  
101 101 def notify(self):
  102 + if self.registration_id is None:
  103 + raise ValueError("user's registration_id is null")
102 104 gcm_ctx = gcm.GCM(GCM_API_KEY)
103 105 try:
104 106 gcm_ctx.plaintext_request(