Skip to content

Commit

Permalink
feat: adding redirects that return correctly to the same page
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Nov 4, 2024
1 parent 33cc61e commit 633010f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/aind_qc_portal/panel/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _set_status(self, status: Status | str):
status : Status or str
"""
if pn.state.user == 'guest':
self.hidden_html.object = "<script>window.location.href = '/login';</script>"
self.hidden_html.object = f"<script>window.location.href = '/login?next={pn.state.location.href}';</script>"
return

if not isinstance(status, Status):
Expand Down
2 changes: 1 addition & 1 deletion src/aind_qc_portal/panel/quality_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def submit_changes(self, *event):

# redirect users to login
if pn.state.user == 'guest':
self.hidden_html.object = "<script>window.location.href = '/login';</script>"
self.hidden_html.object = f"<script>window.location.href = '/login?next={pn.state.location.href}';</script>"
return

qc_update_to_id(self.id, self.data)
Expand Down

0 comments on commit 633010f

Please sign in to comment.