

def save(self):
    'Save the form.'
    server = self.cleaned_data['server']
    if ('://' not in server):
        server = ('http://' + server)
    url_parts = urlparse(server)
    domain_method = url_parts[0]
    domain_name = url_parts[1]
    if domain_name.endswith('/'):
        domain_name = domain_name[:(- 1)]
    site = Site.objects.get_current()
    site.domain = domain_name
    site.save()
    self.siteconfig.set('site_domain_method', domain_method)
    cache_type = self.cleaned_data['cache_type']
    if (cache_type != 'custom'):
        if (cache_type == 'locmem'):
            location = 'reviewboard'
        else:
            location_field = self.CACHE_LOCATION_FIELD_MAP[cache_type]
            location = self.cleaned_data[location_field]
            if (cache_type == 'memcached'):
                location = location.split(';')
        self.siteconfig.set('cache_backend', {
            DEFAULT_FORWARD_CACHE_ALIAS: {
                'BACKEND': self.CACHE_BACKENDS_MAP[cache_type],
                'LOCATION': location,
            },
        })
    super(GeneralSettingsForm, self).save()
    load_site_config()

dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/admin/forms.py GeneralSettingsForm.save/original