def _set_microsite_config_from_obj(self, subdomain, domain, microsite_object): """ Helper internal method to actually find the microsite configuration """ config = microsite_object.values config['subdomain'] = strip_port_from_host(subdomain) config['site_domain'] = strip_port_from_host(domain) config['microsite_config_key'] = microsite_object.key # we take the list of ORGs associated with this microsite from the database mapping # tables. NOTE, for now, we assume one ORG per microsite organizations = microsite_object.get_organizations() # we must have at least one ORG defined if not organizations: raise Exception( 'Configuration error. Microsite {key} does not have any ORGs mapped to it!'.format( key=microsite_object.key ) ) # just take the first one for now, we'll have to change the upstream logic to allow # for more than one ORG binding config['course_org_filter'] = organizations[0] self.current_request_configuration.data = config
def _set_microsite_config(self, microsite_config_key, subdomain, domain): """ Helper internal method to actually find the microsite configuration """ config = settings.MICROSITE_CONFIGURATION[microsite_config_key].copy() config['subdomain'] = strip_port_from_host(subdomain) config['microsite_config_key'] = microsite_config_key config['site_domain'] = strip_port_from_host(domain) template_dir = settings.MICROSITE_ROOT_DIR / microsite_config_key / 'templates' config['template_dir'] = template_dir self.current_request_configuration.data = config