Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: restrict tickets without any team set #1111

Merged
merged 1 commit into from
Apr 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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