Explorar o código

fix(api): expose user ID instead of email address

Peter Thomassen %!s(int64=5) %!d(string=hai) anos
pai
achega
d8413e3482
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      api/desecapi/models.py

+ 1 - 1
api/desecapi/models.py

@@ -152,7 +152,7 @@ class User(AbstractBaseUser):
         ]
         recipient = recipient or self.email
         if reason not in reasons:
-            raise ValueError('Cannot send email to user {} without a good reason: {}'.format(self.email, reason))
+            raise ValueError('Cannot send email to user {} without a good reason: {}'.format(self.pk, reason))
         content_tmpl = get_template('emails/{}/content.txt'.format(reason))
         subject_tmpl = get_template('emails/{}/subject.txt'.format(reason))
         from_tmpl = get_template('emails/from.txt')