Commit c11957f7 authored by John Red Medrano's avatar John Red Medrano

removed checking of alphanumeric on the user level change password

parent 94d969e3
......@@ -28,7 +28,7 @@ from app.businesslayer.changerequest.change_request_template import (
)
from app.applicationlayer.management.account.serializer import ChangeRequestList
from app.applicationlayer.cms.template.approver.serializers import ChangeRequestTemplateApproversSerializer
from app.applicationlayer.cms.template.stakeholder.serializers import ChangeRequestTemplateStakeholdersSerializer
from app.applicationlayer.cms.template.stakeholder.serializers import ChangeRequestTemplateStakeHoldersSerializer
from app.applicationlayer.cms.template.details.serializers import ChangeRequestTemplateDetailsSerializer
from app.applicationlayer.cms.template.attachment.serializers import ChangeRequestTemplateAttachmentsSerializer
from app.applicationlayer.cms.template.header.table_filters import headerFilter
......
......@@ -74,31 +74,32 @@ class ChangePasswordSerializer(serializers.Serializer):
if validated_password:
password = re.match(
'([A-Za-z]+[0-9]|[0-9]+[A-Za-z])[A-Za-z0-9]*',
new_password
)
print("password")
print(password)
print(password)
# password = re.match(
# '([A-Za-z]+[0-9]|[0-9]+[A-Za-z])[A-Za-z0-9]*',
# new_password
# )
if password:
# if password:
new_password = make_password(new_password)
instance_password.update(password=new_password)
# instance = User.objects.get(code=str(instance))
return instance
# new_password = make_password(new_password)
# instance_password.update(password=new_password)
# return instance
elif len(new_password) <= 5:
if len(new_password) <= 5:
raise serializers.ValidationError(
'Password must be minimum of 6 characters'
)
else:
new_password = make_password(new_password)
instance_password.update(password=new_password)
return instance
raise serializers.ValidationError(
'password must be alpha numeric format'
)
# else:
# raise serializers.ValidationError(
# 'password must be alpha numeric format'
# )
else:
raise serializers.ValidationError('Please ensure the old password is correct and both new password & confirm password are the same.')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment