瀏覽代碼

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

Peter Thomassen 5 年之前
父節點
當前提交
d8413e3482
共有 1 個文件被更改,包括 1 次插入1 次删除
  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')