Merge pull request #764 from lasircc/develop

Add setting for HTTPS in email links
This commit is contained in:
Garret Wassermann 2019-07-04 21:42:59 -04:00 committed by GitHub
commit cda16297bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -666,7 +666,12 @@ class Ticket(models.Model):
site = Site.objects.get_current()
except ImproperlyConfigured:
site = Site(domain='configure-django-sites.com')
return u"http://%s%s?ticket=%s&email=%s&key=%s" % (
if settings.HELPDESK_USE_HTTPS_IN_EMAIL_LINK:
protocol = 'https'
else:
protocol = 'http'
return u"%s://%s%s?ticket=%s&email=%s&key=%s" % (
protocol,
site.domain,
reverse('helpdesk:public_view'),
self.ticket_for_url,
@ -687,7 +692,12 @@ class Ticket(models.Model):
site = Site.objects.get_current()
except ImproperlyConfigured:
site = Site(domain='configure-django-sites.com')
return u"http://%s%s" % (
if settings.HELPDESK_USE_HTTPS_IN_EMAIL_LINK:
protocol = 'https'
else:
protocol = 'http'
return u"%s://%s%s" % (
protocol,
site.domain,
reverse('helpdesk:view',
args=[self.id])

View File

@ -149,6 +149,8 @@ QUEUE_EMAIL_BOX_UPDATE_ONLY = getattr(settings, 'QUEUE_EMAIL_BOX_UPDATE_ONLY', F
HELPDESK_ENABLE_PER_QUEUE_STAFF_PERMISSION = getattr(
settings, 'HELPDESK_ENABLE_PER_QUEUE_STAFF_PERMISSION', False)
# use https in the email links
HELPDESK_USE_HTTPS_IN_EMAIL_LINK = getattr(settings, 'HELPDESK_USE_HTTPS_IN_EMAIL_LINK', False)
# Asynchronous Datatables - Optional
HELPDESK_USE_SERVERSIDE_PROCESSING = getattr(