Fix serializer set_password bug
This commit is contained in:
@@ -473,6 +473,11 @@ class MyPasswordChangeSerializer(PasswordChangeSerializer):
|
|||||||
logger.info(msg)
|
logger.info(msg)
|
||||||
raise ValidationError(dict(non_field_errors=msg))
|
raise ValidationError(dict(non_field_errors=msg))
|
||||||
|
|
||||||
|
data = dict(
|
||||||
|
username=self.user.username,
|
||||||
|
password=self.data['new_password1'],
|
||||||
|
)
|
||||||
|
|
||||||
if utils_auth.is_configured():
|
if utils_auth.is_configured():
|
||||||
if utils_auth.set_password(data) != 200:
|
if utils_auth.set_password(data) != 200:
|
||||||
msg = 'Problem connecting to Auth server: set.'
|
msg = 'Problem connecting to Auth server: set.'
|
||||||
@@ -502,6 +507,11 @@ class MyPasswordResetConfirmSerializer(PasswordResetConfirmSerializer):
|
|||||||
logger.info(msg)
|
logger.info(msg)
|
||||||
raise ValidationError(dict(non_field_errors=msg))
|
raise ValidationError(dict(non_field_errors=msg))
|
||||||
|
|
||||||
|
data = dict(
|
||||||
|
username=self.user.username,
|
||||||
|
password=self.data['new_password1'],
|
||||||
|
)
|
||||||
|
|
||||||
if utils_auth.is_configured():
|
if utils_auth.is_configured():
|
||||||
if utils_auth.set_password(data) != 200:
|
if utils_auth.set_password(data) != 200:
|
||||||
msg = 'Problem connecting to Auth server: set.'
|
msg = 'Problem connecting to Auth server: set.'
|
||||||
|
Reference in New Issue
Block a user