perf: 更新密码中也发送邮件 (#4789)

Co-authored-by: ibuler <ibuler@qq.com>
pull/4794/head
fit2bot 2020-10-14 19:59:05 +08:00 committed by GitHub
parent bab76f3cda
commit 5868d56e18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -10,6 +10,7 @@ from common.permissions import (
)
from .. import serializers
from ..models import User
from ..utils import send_reset_password_success_mail
from .mixins import UserQuerysetMixin
__all__ = [
@ -85,3 +86,7 @@ class UserPublicKeyApi(generics.RetrieveUpdateAPIView):
def get_object(self):
return self.request.user
def perform_update(self, serializer):
super().perform_update(serializer)
send_reset_password_success_mail(self.request, self.get_object())