Skip to content

fix!: disable transaction commits during doc events by ankush [frappe] PR#25256

Bot Dokos requested to merge ft-pr-25256 into develop

From: https://github.com/frappe/frappe/pull/25256
Date: 2024-03-28 11:58:38+05:30

  • test: transaction control
  • fix: handle nested event calls
  • fix: disable transaction commits during doc events



Diagnostics

pre-commit failed for source commit: 638dbb6bcd57865eed020ea9fcc6465ac8348e31
Run ruff linter and apply fixes..........................................Failed
- hook id: ruff
- exit code: 1

frappe/database/database.py:60:21: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
frappe/database/database.py:61:22: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
frappe/database/database.py:63:20: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
Found 3 errors.


pre-commit failed for source commit: f66b23b96d4b2a52179c95771f02f3e04c6e2565
Run ruff linter and apply fixes..........................................Failed
- hook id: ruff
- exit code: 1

frappe/database/database.py:64:21: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
frappe/database/database.py:65:22: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
frappe/database/database.py:67:20: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
Found 3 errors.


pre-commit failed for source commit: e5a64fd50c0ce235898f88d8efefd89535711c8c
Run ruff linter and apply fixes..........................................Failed
- hook id: ruff
- exit code: 1

frappe/database/database.py:66:21: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
frappe/database/database.py:67:22: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
frappe/database/database.py:69:20: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
frappe/tests/test_db.py:338:20: RUF015 Prefer `next(...)` over single element slice
frappe/tests/test_db.py:340:4: RUF015 Prefer `next(...)` over single element slice
frappe/tests/test_db.py:345:4: RUF015 Prefer `next(...)` over single element slice
frappe/tests/test_db.py:356:4: RUF015 Prefer `next(...)` over single element slice
frappe/tests/test_db.py:367:4: RUF015 Prefer `next(...)` over single element slice
Found 8 errors.
No fixes available (5 hidden fixes can be enabled with the `--unsafe-fixes` option).



Checkout instructions
# Checkout locally
git fetch upstream
git switch ft-pr-25256

# Alternatively, re-take the changes
git switch develop
ft take ft-pr-25256

# 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

Merge request reports