Skip to content

Commit 0fb1c5f

Browse files
committed
add error 422 handling for change_user_password function
1 parent 4c8745c commit 0fb1c5f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dspace_rest_client/client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,11 @@ def change_user_password(self, user_uuid, current_password, new_password):
15111511
if r.status_code == 200:
15121512
logging.info("Updated Password for user %s", user_uuid)
15131513
return True
1514+
elif r.status_code == 422:
1515+
logging.error(
1516+
"Password does not respect the rules configured in the regular expression."
1517+
)
1518+
return False
15141519
else:
15151520
logging.error("An error occurred updating the password.")
15161521
return False

0 commit comments

Comments
 (0)