Skip to content

fix: exclude disabled users from approver list#4943

Open
nareshkannasln wants to merge 2 commits into
frappe:developfrom
aerele:department-approver-flag
Open

fix: exclude disabled users from approver list#4943
nareshkannasln wants to merge 2 commits into
frappe:developfrom
aerele:department-approver-flag

Conversation

@nareshkannasln

@nareshkannasln nareshkannasln commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description: Approver searches in get_approvers() return disabled Users for leave, expense, and shift approvals. Filter both the direct employee approvers and the department-tree approvers on enabled = 1 so deactivated users are no longer selectable.

Before:

Screencast.from.2026-07-16.12-53-05.webm

After:

Screencast.from.2026-07-16.12-49-50.webm

Backport needed for v15, v16

@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — the change is narrow, additive, and correctly filters disabled users at the query level.

Both the direct lookup path and the department-tree loop correctly add the enabled filter; the frappe.qb migration preserves all existing conditions and the @frappe.validate_and_sanitize_search_inputs decorator continues to protect the txt input.

No files require special attention.

Reviews (2): Last reviewed commit: "chore: update query to qb" | Re-trigger Greptile

@mergify

mergify Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Comment thread hrms/hr/doctype/department_approver/department_approver.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants