Merge pull request #25941 from open-craft/mtyaka/SE-2888-forum-notification-url
Fix URL in forum notification post.
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user