refactor: validation to prevent recursion with mixed conditions by ruthra-kumar [frappe] PR#42143
From: https://github.com/frappe/erpnext/pull/42143
Date: 2024-07-03 17:54:41+05:30
- test: validation on mixed condition and recursion on pricing rule
- test: validation on mixed condition with recursion
- fix: use standard method to get
_doc_before_save - refactor: validation to prevent recursion with mixed conditions
Diagnostics
pre-commit failed for source commit: 406dfd528f2cabc60ece0c917fb02092abed50cc
Run ruff linter..........................................................Failed
- hook id: ruff
- exit code: 1
erpnext/accounts/doctype/promotional_scheme/promotional_scheme.py:193:6: B007 Loop control variable `idx` not used within loop body
erpnext/accounts/doctype/promotional_scheme/promotional_scheme.py:229:29: RUF013 PEP 484 prohibits implicit `Optional`
erpnext/accounts/doctype/promotional_scheme/promotional_scheme.py:229:63: RUF013 PEP 484 prohibits implicit `Optional`
Found 3 errors.
No fixes available (3 hidden fixes can be enabled with the `--unsafe-fixes` option).
Run ruff formatter.......................................................Failed
- hook id: ruff-format
- files were modified by this hook
1 file reformatted, 1 file left unchanged
pre-commit failed for source commit: 9d7be293ae9d7d2a7cf9f81fa1aadcc071bc29e6
Run ruff linter..........................................................Failed
- hook id: ruff
- exit code: 1
erpnext/accounts/doctype/promotional_scheme/promotional_scheme.py:191:6: B007 Loop control variable `idx` not used within loop body
erpnext/accounts/doctype/promotional_scheme/promotional_scheme.py:233:57: RUF013 PEP 484 prohibits implicit `Optional`
erpnext/accounts/doctype/promotional_scheme/promotional_scheme.py:233:91: RUF013 PEP 484 prohibits implicit `Optional`
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-42143
# Alternatively, re-take the changes
git switch develop
ft take ft-pr-42143
# 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