Skip to content

Commit

Permalink
refactor: patch
Browse files Browse the repository at this point in the history
  • Loading branch information
RitvikSardana committed Nov 13, 2024
1 parent 4c5171d commit b669151
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions helpdesk/patches/update_hd_team_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@ def execute():

for agent in existing_agents:
is_agent_active = frappe.get_value("HD Agent", agent, "is_active")
if not is_agent_active:
continue

if is_agent_active:
if agent not in team_users:
team_doc = (
frappe.get_doc("HD Team", team)
.append("users", {"user": agent})
.save()
)
print("Agent Added")
if is_agent_active and agent not in team_users:
team_doc = (
frappe.get_doc("HD Team", team)
.append("users", {"user": agent})
.save()
)
print("Agent Added")

0 comments on commit b669151

Please sign in to comment.