Skip to content

Commit

Permalink
fix(api): is_agent: do not set param in function (#1307)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssiyad committed Jul 13, 2023
1 parent cdfd030 commit b67d9d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helpdesk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
from frappe.utils.telemetry import capture as _capture


def is_agent(user: str = frappe.session.user) -> bool:
def is_agent(user: str = None) -> bool:
"""
Check whether `user` is an agent
:param user: User to check against, defaults to current user
:return: Whether `user` is an agent
"""
user = user or frappe.session.user
return bool(frappe.db.exists("HD Agent", {"name": user}))


Expand Down

0 comments on commit b67d9d6

Please sign in to comment.