p
Press
•
perf
other-apps
Avoid redundant Team doc loads and N+1 queries
Press Role guards called frappe.get_doc("Team", ...) just to call is_team_owner()/is_admin_user(), loading every row of team_members, discounts, and other children. Extracted these methods to use direct DB queries, cutting cost and eliminating N+1s.