Merge pull request #17879 from edx/bmedx/remove_default_site_from_attributes

Exclude the default site from UserAttribute 'created_on_site'
This commit is contained in:
Brian Mesick
2018-04-04 15:46:58 -04:00
committed by GitHub

View File

@@ -402,9 +402,12 @@ def generate_activation_email_context(user, registration):
def create_or_set_user_attribute_created_on_site(user, site):
"""
Create or Set UserAttribute indicating the microsite site the user account was created on.
User maybe created on 'courses.edx.org', or a white-label site
User maybe created on 'courses.edx.org', or a white-label site. Due to the very high
traffic on this table we now ignore the default site (eg. 'courses.edx.org') and
code which comsumes this attribute should assume a 'created_on_site' which doesn't exist
belongs to the default site.
"""
if site:
if site and site.id != settings.SITE_ID:
UserAttribute.set_user_attribute(user, 'created_on_site', site.domain)