Use COMMON_PROJECT_URL as host for document link

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-05-15 02:43:50 -04:00
parent 8586bd1909
commit a5ab9f3ea6
3 changed files with 12 additions and 4 deletions

View File

@@ -265,6 +265,9 @@
* Show a null mailer backend if there is backend with an
invalid path. Due to the app full path change, existing
mailer setups need to be recreated.
* The document link URL when mailed is now composed of the
COMMON_PROJECT_URL + document URL instead of the Site
domain.
3.1.11 (2019-04-XX)
===================

View File

@@ -575,6 +575,9 @@ Other changes
* Show a null mailer backend if there is backend with an
invalid path. Due to the app full path change, existing
mailer setups need to be recreated.
* The document link URL when mailed is now composed of the
COMMON_PROJECT_URL + document URL instead of the Site
domain.
Removals

View File

@@ -3,7 +3,8 @@ from __future__ import unicode_literals
import json
import logging
from django.contrib.sites.models import Site
from furl import furl
from django.core import mail
from django.db import models, transaction
from django.template import Context, Template
@@ -11,6 +12,8 @@ from django.utils.html import strip_tags
from django.utils.module_loading import import_string
from django.utils.translation import ugettext_lazy as _
from mayan.apps.common.settings import setting_project_url
from .classes import NullBackend
from .events import event_email_sent
from .managers import UserMailerManager
@@ -174,10 +177,9 @@ class UserMailer(models.Model):
Send a document using this user mailing profile.
"""
context_dictionary = {
'link': 'http://%s%s' % (
Site.objects.get_current().domain,
'link': furl(setting_project_url.value).join(
document.get_absolute_url()
),
).tostr(),
'document': document
}