Fix bug when saving user preferences theme
it was being saved even when it should have been empty value
This commit is contained in:
parent
8b3a9c9dad
commit
ba32422059
|
@ -612,14 +612,25 @@ class UserView(PrincipalMasterView):
|
|||
# display
|
||||
{'section': f'tailbone.{user.uuid}',
|
||||
'option': 'user_css',
|
||||
'value': user_css},
|
||||
'value': user_css,
|
||||
'save_if_empty': False},
|
||||
]
|
||||
|
||||
def preferences_gather_settings(self, data, user):
|
||||
simple_settings = self.preferences_get_simple_settings(user)
|
||||
return self.configure_gather_settings(
|
||||
settings = self.configure_gather_settings(
|
||||
data, simple_settings=simple_settings, input_file_templates=False)
|
||||
|
||||
# TODO: ugh why does user_css come back as 'default' instead of None?
|
||||
final_settings = []
|
||||
for setting in settings:
|
||||
if setting['name'].endswith('.user_css'):
|
||||
if setting['value'] == 'default':
|
||||
continue
|
||||
final_settings.append(setting)
|
||||
|
||||
return final_settings
|
||||
|
||||
def preferences_remove_settings(self, user):
|
||||
app = self.get_rattail_app()
|
||||
simple_settings = self.preferences_get_simple_settings(user)
|
||||
|
|
Loading…
Reference in a new issue