Merge pull request #25941 from open-craft/mtyaka/SE-2888-forum-notification-url

Fix URL in forum notification post.
This commit is contained in:
Jason Myatt
2021-03-08 09:13:20 -05:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -167,10 +167,12 @@ def _build_message_context(context): # lint-amnesty, pylint: disable=missing-fu
def _get_thread_url(context): # lint-amnesty, pylint: disable=missing-function-docstring
scheme = 'https' if settings.HTTPS == 'on' else 'http'
base_url = '{}://{}'.format(scheme, context['site'].domain)
thread_content = {
'type': 'thread',
'course_id': context['course_id'],
'commentable_id': context['thread_commentable_id'],
'id': context['thread_id'],
}
return urljoin(context['site'].domain, permalink(thread_content))
return urljoin(base_url, permalink(thread_content))

View File

@@ -212,7 +212,7 @@ class TaskTestCase(ModuleStoreTestCase): # lint-amnesty, pylint: disable=missin
'thread_title': 'thread-title',
'thread_username': self.thread_author.username,
'thread_commentable_id': self.thread['commentable_id'],
'post_link': self.mock_permalink.return_value,
'post_link': 'https://{}{}'.format(site.domain, self.mock_permalink.return_value),
'site': site,
'site_id': site.id
})