Base default participant role on event join_options instead of visbility

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-02-07 17:09:04 +01:00
parent a9dcd13578
commit f5e6bd6a23

View File

@ -676,14 +676,14 @@ defmodule Mobilizon.Events do
end end
@doc """ @doc """
Get the default participant role depending on the event visbility Get the default participant role depending on the event join options
""" """
def get_default_participant_role(%Event{} = event) do def get_default_participant_role(%Event{} = event) do
case event.visibility do case event.join_options do
# Participant # Participant
:public -> 1 :free -> :participant
# Not approved # Not approved
_ -> 0 _ -> :not_approved
end end
end end