Normalise the password. Flask security normalized the password prior to changing or comparing using Python unicodedata.normalize(). As we are not using flask security form to add/update user, we need custom function to do the same.
(password)
| 541 | |
| 542 | |
| 543 | def normalise_password(password): |
| 544 | """ |
| 545 | Normalise the password. |
| 546 | Flask security normalized the password prior to changing or comparing using |
| 547 | Python unicodedata.normalize(). As we are not using flask security form |
| 548 | to add/update user, we need custom function to do the same. |
| 549 | """ |
| 550 | normalise_form = current_app.config.get( |
| 551 | 'SECURITY_PASSWORD_NORMALIZE_FORM', |
| 552 | 'NFKD' |
| 553 | ) |
| 554 | |
| 555 | return password if is_normalized(normalise_form, password) else\ |
| 556 | normalize(normalise_form, password) |
| 557 | |
| 558 | |
| 559 | def validate_unique_role(data): |
no test coverage detected