fix(email_account): select backend_app_flow when retrieving email_account by borisroman [frappe] PR#31289

From: https://github.com/frappe/frappe/pull/31289
Date: 2025-02-17 11:40:21+01:00

  • fix(email_account): select backend_app_flow when retrieving email_account



Diagnostics

pre-commit failed for source commit: 01916192be5a08cabbffe0cdc67af5b50b2caadd
[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/email/doctype/email_account/email_account.py:45:15: RUF005 Consider `[*list(kwargs.values()), "default"]` instead of concatenation
   |
44 |             cached_accounts = getattr(frappe.local, cache_name)
45 |             match_by = list(kwargs.values()) + ["default"]
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUF005
46 |             matched_accounts = list(filter(None, [cached_accounts.get(key) for key in match_by]))
47 |             if matched_accounts:
   |
   = help: Replace with `[*list(kwargs.values()), "default"]`

frappe/email/doctype/email_account/email_account.py:52:32: RUF015 Prefer `next(iter(matched_accounts.values()))` over single element slice
   |
50 |             matched_accounts = func(*args, **kwargs)
51 |             cached_accounts.update(matched_accounts or {})
52 |             return matched_accounts and list(matched_accounts.values())[0]
   |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUF015
53 |
54 |         return wrapper_cache_email_account
   |
   = help: Replace with `next(iter(matched_accounts.values()))`

Found 2 errors.
No fixes available (2 hidden fixes can be enabled with the `--unsafe-fixes` option).



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

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

# 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

Loading