backport fix for ISE when loading admin pages; r=me default tip @
authorbyron jones <glob@mozilla.com>
Wed, 14 Mar 2018 14:49:06 +0800
changeset 76 c7129035a1d77d8c99f1bab47b6c46dc3e8b8b16
parent 75 f3d30cc0312ed6947f7bd625f5ff75680a5be17a
push id44
push userbjones@mozilla.com
push dateWed, 14 Mar 2018 06:50:32 +0000
reviewersme
backport fix for ISE when loading admin pages; r=me backport https://github.com/reviewboard/reviewboard/commit/acaa7b2 which was fixed in 3.0.2 but not in the 2.x branches.
reviewboard/reviewboard/admin/forms.py
--- a/reviewboard/reviewboard/admin/forms.py
+++ b/reviewboard/reviewboard/admin/forms.py
@@ -255,17 +255,18 @@ class GeneralSettingsForm(SiteSettingsFo
 
         super(GeneralSettingsForm, self).save()
 
         # Reload any important changes into the Django settings.
         load_site_config()
 
     def full_clean(self):
         """Clean and validate all form fields."""
-        cache_type = self['cache_type'].data or self['cache_type'].initial
+        cache_type = (self['cache_type'].data or
+                      self.fields['cache_type'].initial)
 
         for iter_cache_type, field in six.iteritems(
                 self.CACHE_LOCATION_FIELD_MAP):
             self.fields[field].required = (cache_type == iter_cache_type)
 
         return super(GeneralSettingsForm, self).full_clean()
 
     def clean_cache_host(self):