Skip to content

Commit

Permalink
fix credo
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-martinez committed Apr 2, 2024
1 parent e5d0ece commit 4790525
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apps/lenra/lib/lenra/kubernetes/api_services.ex
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,10 @@ defmodule Lenra.Kubernetes.ApiServices do
case partial_env
|> Repo.preload(deployment: [:build])
|> Repo.preload([:application]) do
%{application: app, deployment: %{build: build}} when not is_nil(build) ->
%{application: _app, deployment: %{build: nil}} ->
{:error, :build_not_exist}

%{application: _app, deployment: %{build: build}} ->
Lenra.OpenfaasServices.update_secrets(service_name, build.build_number, [])
# TODO: Return all other secrets
{:ok, []}
Expand Down
4 changes: 3 additions & 1 deletion apps/lenra_web/lib/lenra_web/app_adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ defmodule LenraWeb.AppAdapter do
}),
do: true

def authorize(:join_app, user, app) when not is_nil(user) do
def authorize(:join_app, nil, _app), do: false

def authorize(:join_app, user, app) do
case Apps.fetch_user_env_access(
environment_id: app.main_env.environment.id,
user_id: user.id
Expand Down

0 comments on commit 4790525

Please sign in to comment.