mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Only update theme if value provided (#5240)
- Handles case where null or invalid value provided
This commit is contained in:
parent
bd1689095d
commit
41167f22c9
@ -639,8 +639,12 @@ class AppearanceSelectView(RedirectView):
|
||||
user_theme = common_models.ColorTheme()
|
||||
user_theme.user = request.user
|
||||
|
||||
user_theme.name = theme
|
||||
user_theme.save()
|
||||
if theme:
|
||||
try:
|
||||
user_theme.name = theme
|
||||
user_theme.save()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return redirect(reverse_lazy('settings'))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user