Skip to content

Commit

Permalink
only store non-None session variables
Browse files Browse the repository at this point in the history
Signed-off-by: F.N. Claessen <[email protected]>
  • Loading branch information
Flix6x committed Jul 27, 2023
1 parent 01759da commit 129b5d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flexmeasures/ui/utils/view_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ def set_session_variables(*var_names: str):
>>> set_session_variables("event_starts_after", "event_ends_before", "chart_type")
"""
for var_name in var_names:
session[var_name] = request.values.get(var_name)
var = request.values.get(var_name)
if var is not None:
session[var_name] = var


def set_time_range_for_session():
Expand Down

0 comments on commit 129b5d9

Please sign in to comment.