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

Bug/WP-364: Ticket creation emails are not sent to 'cc' emails #1017

Merged
merged 7 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion client/src/components/Tickets/TicketCreateForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function TicketCreateForm({
<FormField
name="cc"
label="Cc"
description="Separate emails with commas"
description="Separate emails with commas. NOTE: Emails listed here will only receive emails on replies to tickets."
jmcmillenmusic marked this conversation as resolved.
Show resolved Hide resolved
/>
</Col>
</Row>
Expand Down
2 changes: 1 addition & 1 deletion server/portal/apps/onboarding/steps/project_membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def send_project_request(self, request):
username=self.user.username
),
Text=ticket_text,
Requestors=self.user.email,
Requestor=self.user.email,
CF_resource=settings.RT_TAG
)
tracker.logout()
Expand Down
2 changes: 1 addition & 1 deletion server/portal/apps/tickets/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def post(self, request):
data = request.POST.copy()
subject = data.get('subject')
problem_description = data.get('problem_description')
cc = data.get('cc', '')
cc = data.get('cc', [''])
jmcmillenmusic marked this conversation as resolved.
Show resolved Hide resolved
attachments = [(f.name, ContentFile(f.read()), f.content_type)
for f in request.FILES.getlist('attachments')]
info = request.GET.get('info', "None")
Expand Down
8 changes: 4 additions & 4 deletions server/portal/apps/tickets/rtUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ def __init__(self):

def getUserTickets(self, userEmail, status="ALL"):
if not status == "ALL":
ticket_list = self.tracker.search(Queue=rt.ALL_QUEUES, Requestors__exact=userEmail, Status__exact=status,
ticket_list = self.tracker.search(Queue=rt.ALL_QUEUES, Requestor__exact=userEmail, Status__exact=status,
jmcmillenmusic marked this conversation as resolved.
Show resolved Hide resolved
order='-LastUpdated')
else:
ticket_list = self.tracker.search(Queue=rt.ALL_QUEUES, Requestors__exact=userEmail, order='-LastUpdated')
ticket_list = self.tracker.search(Queue=rt.ALL_QUEUES, Requestor__exact=userEmail, order='-LastUpdated')

for ticket in ticket_list:
ticket['id'] = ticket['id'].replace('ticket/', '')
Expand All @@ -42,7 +42,7 @@ def getTicketHistory(self, ticket_id):

return ticketHistory

def create_ticket(self, attachments, subject, problem_description, requestor, cc):
def create_ticket(self, attachments, subject, problem_description, requestor, cc=[]):
return self.tracker.create_ticket(Queue=self.rtQueue,
files=attachments,
Subject=subject,
Expand All @@ -60,7 +60,7 @@ def replyToTicket(self, ticket_id, reply_text, files=[]):
def hasAccess(self, ticket_id, user=None):
if user and ticket_id:
ticket = self.tracker.get_ticket(ticket_id)
if DjangoRt.contains_user(ticket.get('Requestors', ''), user) or DjangoRt.contains_user(ticket.get('Cc', ''), user):
if DjangoRt.contains_user(ticket.get('Requestor', ''), user) or DjangoRt.contains_user(ticket.get('Cc', ''), user):
return True

return False
Expand Down
Loading