fix: use strip_html() instead of escape_html() by akhilnarang [frappe] PR#30884
From: https://github.com/frappe/frappe/pull/30884
Date: 2025-01-27 15:29:18+05:30
- fix: use strip_html() instead of escape_html()
Diagnostics
pre-commit failed for source commit: 4ef862922847ff7a644dc14e11e9c3b8e37f40dc
[WARNING] top-level `default_stages` uses deprecated stage names (commit) which will be removed in a future version. run: `pre-commit migrate-config` to automatically fix this.
frappe/core/doctype/user/user.py:917:56: RUF013 PEP 484 prohibits implicit `Optional`
|
915 | @frappe.whitelist(allow_guest=True, methods=["POST"])
916 | def update_password(
917 | new_password: str, logout_all_sessions: int = 0, key: str = None, old_password: str = None
| ^^^ RUF013
918 | ):
919 | """Update password for the current user.
|
= help: Convert to `T | None`
frappe/core/doctype/user/user.py:917:82: RUF013 PEP 484 prohibits implicit `Optional`
|
915 | @frappe.whitelist(allow_guest=True, methods=["POST"])
916 | def update_password(
917 | new_password: str, logout_all_sessions: int = 0, key: str = None, old_password: str = None
| ^^^ RUF013
918 | ):
919 | """Update password for the current user.
|
= help: Convert to `T | None`
frappe/core/doctype/user/user.py:1290:28: RUF005 Consider `[warning, *suggestions]` instead of concatenation
|
1288 | warning = feedback.get("warning", "")
1289 |
1290 | frappe.throw(msg=" ".join([warning] + suggestions), title=_("Invalid Password"))
| ^^^^^^^^^^^^^^^^^^^^^^^ RUF005
|
= help: Replace with `[warning, *suggestions]`
Found 3 errors.
No fixes available (3 hidden fixes can be enabled with the `--unsafe-fixes` option).
Checkout instructions
# Checkout locally
git fetch upstream
git switch ft-pr-30884
# Alternatively, re-take the changes
git switch develop
ft take ft-pr-30884
# Make changes then rebase
git rebase -i develop
# Fix or ignore conflicts
git checkout --theirs .
git rebase --continue
# Force-push changes
git push --force-with-lease