Skip to content

Commit

Permalink
routing: fix redirect logic
Browse files Browse the repository at this point in the history
  • Loading branch information
s-cork committed May 16, 2024
1 parent df2b4b1 commit 326573c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions client_code/routing/_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,17 @@ def load_template_or_redirect(url_hash, url_pattern, url_dict, properties, nav_c
path = next(path for path in paths if url_hash.startswith(path))
except StopIteration:
continue

if condition is None:
break
pass
elif not condition():
continue
elif type(info) is TemplateInfo:

if type(info) is TemplateInfo:
break

redirect_hash = callable_()

if isinstance(redirect_hash, str):
if navigation_context.matches_current_context(redirect_hash):
# would cause an infinite loop
Expand Down

0 comments on commit 326573c

Please sign in to comment.