Skip to content

Commit

Permalink
fix: default to current_workspace in publish_dialog for non-editors
Browse files Browse the repository at this point in the history
  • Loading branch information
nikochiko committed Mar 10, 2025
1 parent 673be82 commit afebc60
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion daras_ai_v2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,10 +851,15 @@ def _render_workspace_selector(self, *, key: str) -> "Workspace":
if self.current_pr.workspace_id and self.can_user_edit_published_run(
self.current_pr
):
# make current_pr.workspace the first option
# default to current_pr.workspace for an editor
workspace_options = {
self.current_pr.workspace_id: self.current_pr.workspace
} | workspace_options
else:
# default to current workspace for everyone else
workspace_options = {
self.current_workspace.id: self.current_workspace
} | workspace_options

with gui.div(className="d-flex gap-3"):
with gui.div(className="mt-2 text-nowrap"):
Expand Down

0 comments on commit afebc60

Please sign in to comment.