Skip to content

Contribute: Remove example.com text from html emails #885

Description

@OmarIthawi

Contribute the fixes below:

A) #884 has a fix for the incorrect get_current_site logic. The fix is contributable.

The bug is resolved by replacing:

Site.objects.get_current() (Django) --> get_current_site() (edX's)

Because the Django get_current returns the default site (with settings.SITE_ID) always.

The edX function is more site aware and returns the current site by using the request.site value which is the desired behaviour and would prevent the HTML emails from showing example.com in the email body as described in RED-1886.

B) #925 fix activation email server error in celery

The error happened because of the incomplete example.com fix in #884

This commit fixes the issue by getting back the mandatory emulate_http_request but now with a better method to know the site using our appsembler.sites.utils helpers.

This should work on celery tasks while printing the correct site domain instead of example.com as it used to do before RED-1886 was fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream-contributionA suggestion for contributing changes to Open edX

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions