2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-14 19:15:41 +00:00

Only update theme if value provided (#5240) (#5241)

- Handles case where null or invalid value provided

(cherry picked from commit 41167f22c9)

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
github-actions[bot]
2023-07-13 20:39:28 +10:00
committed by GitHub
parent 6730098bac
commit 8a58bf5ffa

View File

@ -640,8 +640,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'))