Change can_be_managed_by/2
to can_be_managed_by?/2
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
505b16611b
commit
6066a44ae8
|
@ -188,13 +188,11 @@ defmodule Mobilizon.Events.Event do
|
|||
@doc """
|
||||
Checks whether an event can be managed.
|
||||
"""
|
||||
@spec can_be_managed_by(t, integer | String.t()) :: boolean
|
||||
def can_be_managed_by(%__MODULE__{organizer_actor_id: organizer_actor_id}, actor_id)
|
||||
when organizer_actor_id == actor_id do
|
||||
{:event_can_be_managed, true}
|
||||
end
|
||||
@spec can_be_managed_by?(t, integer | String.t()) :: boolean
|
||||
def can_be_managed_by?(%__MODULE__{organizer_actor_id: organizer_actor_id}, actor_id),
|
||||
do: organizer_actor_id == actor_id
|
||||
|
||||
def can_be_managed_by(_event, _actor), do: {:event_can_be_managed, false}
|
||||
def can_be_managed_by?(_event, _actor), do: false
|
||||
|
||||
@spec put_tags(Changeset.t(), map) :: Changeset.t()
|
||||
defp put_tags(%Changeset{} = changeset, %{tags: tags}) do
|
||||
|
|
Loading…
Reference in a new issue