Skip to content

Commit

Permalink
fix: restrict tickets without any team set (#1111)
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib committed Apr 12, 2023
1 parent a7796db commit ea5aab3
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,9 @@ def filter_by_team(query: Query):
criterions = [QBTicket.agent_group == team.name for team in teams]

# Consider tickets without any assigned agent group
filter_unassigned: str = (
frappe.get_value(
"HD Settings",
None,
"do_not_restrict_tickets_without_an_agent_group",
)
or "0"
)

if not int(filter_unassigned):
do_not_restrict = frappe.db.get_single_value("HD Settings", "do_not_restrict_tickets_without_an_agent_group")
if not do_not_restrict:
# include those which are not assigned to any team
criterions.append(QBTicket.agent_group.isnull())

query = query.where(Criterion.any(criterions))
Expand Down

0 comments on commit ea5aab3

Please sign in to comment.