Base default participant role on event join_options instead of visbility
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
a9dcd13578
commit
f5e6bd6a23
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user