Skip to content

Commit

Permalink
fix: Workspace.DoesNotExist
Browse files Browse the repository at this point in the history
User must be logged in to get their workspace on functions recipe
  • Loading branch information
devxpy committed Dec 25, 2024
1 parent 37a8a17 commit b2600b7
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions recipes/Functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from functions.models import CalledFunction, VariableSchema
from managed_secrets.models import ManagedSecret
from managed_secrets.widgets import edit_secret_button_with_dialog
from workspaces.models import Workspace


class ConsoleLogs(BaseModel):
Expand Down Expand Up @@ -145,14 +146,16 @@ def render_variables(self):
help=field_desc(self.RequestModel, "secrets"),
unsafe_allow_html=True,
)
edit_secret_button_with_dialog(
self.current_workspace,
self.request.user,
trigger_label=f"{icons.add} Add",
trigger_type="tertiary",
trigger_className="p-1 mb-2",
)

try:
edit_secret_button_with_dialog(
self.current_workspace,
self.request.user,
trigger_label=f"{icons.add} Add",
trigger_type="tertiary",
trigger_className="p-1 mb-2",
)
except Workspace.DoesNotExist:
pass
options = list(
set(
self.current_workspace.managed_secrets.order_by(
Expand Down

0 comments on commit b2600b7

Please sign in to comment.