refactor: fix credo warnings, update gettext
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
05c81af6e9
commit
5e0b6580ae
6 changed files with 487 additions and 83 deletions
|
|
@ -23,15 +23,15 @@ defmodule MvWeb.GroupLive.Index do
|
|||
actor = current_actor(socket)
|
||||
|
||||
# Check if user can read groups
|
||||
unless can?(actor, :read, Mv.Membership.Group) do
|
||||
{:ok, redirect(socket, to: ~p"/members")}
|
||||
else
|
||||
if can?(actor, :read, Mv.Membership.Group) do
|
||||
groups = load_groups(actor)
|
||||
|
||||
{:ok,
|
||||
socket
|
||||
|> assign(:page_title, gettext("Groups"))
|
||||
|> assign(:groups, groups)}
|
||||
else
|
||||
{:ok, redirect(socket, to: ~p"/members")}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue