fix: access role from membership association in create_test_user script
Organizations have memberships with roles, not direct role attribute
This commit is contained in:
parent
b3af717013
commit
659490c405
1 changed files with 3 additions and 1 deletions
|
|
@ -98,7 +98,9 @@ case Accounts.get_user_by_email(email) do
|
|||
orgs =
|
||||
user.id
|
||||
|> Organizations.list_user_organizations()
|
||||
|> Enum.filter(&(&1.role == :owner))
|
||||
|> Enum.filter(fn org ->
|
||||
Enum.any?(org.memberships, &(&1.role == :owner))
|
||||
end)
|
||||
|
||||
if Enum.empty?(orgs) do
|
||||
IO.puts("\n[WARN] User has no organizations")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue