MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / validate_password

Function validate_password

web/pgadmin/tools/user_management/__init__.py:571–586  ·  view source on GitHub ↗

Check password new and confirm password match. If both passwords are not match raise exception. :param data: Data. :param new_data: new data dict.

(data, new_data)

Source from the content-addressed store, hash-verified

569
570
571def validate_password(data, new_data):
572 """
573 Check password new and confirm password match. If both passwords are not
574 match raise exception.
575 :param data: Data.
576 :param new_data: new data dict.
577 """
578 if ('newPassword' in data and data['newPassword'] != "" and
579 'confirmPassword' in data and data['confirmPassword'] != ""):
580
581 if data['newPassword'] == data['confirmPassword']:
582 new_data['password'] = hash_password(normalise_password(
583 data['newPassword'])
584 )
585 else:
586 raise InternalServerError(_("Passwords do not match."))
587
588
589def validate_unique_user(data):

Callers 1

validate_userFunction · 0.85

Calls 1

normalise_passwordFunction · 0.85

Tested by

no test coverage detected