Merge branch 'main' into stable

This commit is contained in:
Christopher Broderick 2023-03-10 23:39:40 +00:00 committed by GitHub
commit dc6db21368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 34 deletions

View File

@ -499,6 +499,11 @@ def create_object_from_email_message(message, ticket_id, payload, files, logger)
logger.info(
"Message seems to be auto-reply, not sending any emails back to the sender")
else:
send_info_email(message_id, f, ticket, context, queue, new)
return ticket
def send_info_email(message_id: str, f: FollowUp, ticket: Ticket, context: dict, queue: dict, new: bool):
# send mail to appropriate people now depending on what objects
# were created and who was CC'd
# Add auto-reply headers because it's an auto-reply and we must
@ -531,8 +536,6 @@ def create_object_from_email_message(message, ticket_id, payload, files, logger)
extra_headers=extra_headers,
)
return ticket
def get_ticket_id_from_subject_slug(
queue_slug: str,

View File

@ -81,12 +81,12 @@ def text_is_spam(text, request):
# This will return 'True' is the given text is deemed to be spam, or
# False if it is not spam. If it cannot be checked for some reason, we
# assume it isn't spam.
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
try:
from akismet import Akismet
except ImportError:
return False
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
try:
site = Site.objects.get_current()
except ImproperlyConfigured: