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

develop to master #1799

Merged
merged 77 commits into from
May 23, 2024
Merged

develop to master #1799

merged 77 commits into from
May 23, 2024

Conversation

sumitbhanushali
Copy link
Collaborator

No description provided.

@@ -14,6 +14,7 @@ def get_ticket_obj():

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[black-format] reported by reviewdog 🐶

Suggested change

@@ -14,6 +14,7 @@ def get_ticket_obj():

non_agent = "[email protected]"
agent = "[email protected]"
agent2 = "[email protected]"
class TestHDTicket(FrappeTestCase):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[black-format] reported by reviewdog 🐶

Suggested change
class TestHDTicket(FrappeTestCase):
class TestHDTicket(FrappeTestCase):

Comment on lines +39 to +47
frappe.get_doc({
"doctype": "User",
"first_name": "Agent2",
"email": agent2
}).insert()
frappe.get_doc({
"doctype": "HD Agent",
"user": agent2
}).insert()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[black-format] reported by reviewdog 🐶

Suggested change
frappe.get_doc({
"doctype": "User",
"first_name": "Agent2",
"email": agent2
}).insert()
frappe.get_doc({
"doctype": "HD Agent",
"user": agent2
}).insert()
frappe.get_doc(
{"doctype": "User", "first_name": "Agent2", "email": agent2}
).insert()
frappe.get_doc({"doctype": "HD Agent", "user": agent2}).insert()

notification = frappe.get_all("HD Notification", filters={"reference_ticket": ticket.name, "notification_type": "Assignment", "user_to": agent, "user_from": "Administrator"})
self.assertEqual(len(notification), 1)
ticket.assign_agent(agent2)
notification = frappe.get_all("HD Notification", filters={"reference_ticket": ticket.name, "notification_type": "Assignment", "user_to": ["in", [agent, agent2]], "user_from": "Administrator"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[black-format] reported by reviewdog 🐶

Suggested change
notification = frappe.get_all("HD Notification", filters={"reference_ticket": ticket.name, "notification_type": "Assignment", "user_to": ["in", [agent, agent2]], "user_from": "Administrator"})
notification = frappe.get_all(
"HD Notification",
filters={
"reference_ticket": ticket.name,
"notification_type": "Assignment",
"user_to": ["in", [agent, agent2]],
"user_from": "Administrator",
},
)

self.assertEqual(len(notification), 1)
ticket.assign_agent(agent2)
notification = frappe.get_all("HD Notification", filters={"reference_ticket": ticket.name, "notification_type": "Assignment", "user_to": ["in", [agent, agent2]], "user_from": "Administrator"})
self.assertEqual(len(notification), 2)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[black-format] reported by reviewdog 🐶

Suggested change

@@ -193,9 +194,10 @@ def on_update(self):
if self.status == "Open":
if self.get_doc_before_save() and self.get_doc_before_save().status != "Open":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[black-format] reported by reviewdog 🐶

Suggested change
if self.get_doc_before_save() and self.get_doc_before_save().status != "Open":
if (
self.get_doc_before_save()
and self.get_doc_before_save().status != "Open"
):

agents = self.get_assigned_agents()
if agents:
for agent in agents:
self.notify_agent(agent.name, "Reaction")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[black-format] reported by reviewdog 🐶

Suggested change

# the agent is already set as an assignee
return

clear_all_assignments("HD Ticket", self.name)
assign({"assign_to": [agent], "doctype": "HD Ticket", "name": self.name})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[black-format] reported by reviewdog 🐶

Suggested change

# the agent is already set as an assignee
return

clear_all_assignments("HD Ticket", self.name)
assign({"assign_to": [agent], "doctype": "HD Ticket", "name": self.name})

if frappe.session.user != agent:
self.notify_agent(agent, "Assignment")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[black-format] reported by reviewdog 🐶

Suggested change

@@ -467,13 +463,13 @@ def new_comment(self, content: str):

@frappe.whitelist()
def reply_via_agent(
self, message: str, cc: str = None, bcc: str = None, attachments: List[str] = []
self, message: str, to: str = None, cc: str = None, bcc: str = None, attachments: List[str] = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[black-format] reported by reviewdog 🐶

Suggested change
self, message: str, to: str = None, cc: str = None, bcc: str = None, attachments: List[str] = []
self,
message: str,
to: str = None,
cc: str = None,
bcc: str = None,
attachments: List[str] = [],

@sumitbhanushali sumitbhanushali merged commit 5cb8dab into main May 23, 2024
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant