ソースを参照

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
         recipient = recipient or self.email
         if reason not in reasons:
         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))
         content_tmpl = get_template('emails/{}/content.txt'.format(reason))
         subject_tmpl = get_template('emails/{}/subject.txt'.format(reason))
         subject_tmpl = get_template('emails/{}/subject.txt'.format(reason))
         from_tmpl = get_template('emails/from.txt')
         from_tmpl = get_template('emails/from.txt')