2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-13 10:35:40 +00:00

Only update theme if value provided (#5240)

- Handles case where null or invalid value provided
This commit is contained in:
Oliver
2023-07-13 20:34:41 +10:00
committed by GitHub
parent bd1689095d
commit 41167f22c9

View File

@ -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'))