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 250f0b3bd1
commit d1d3beeb35
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -676,14 +676,14 @@ defmodule Mobilizon.Events do
end
@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
case event.visibility do
case event.join_options do
# Participant
:public -> 1
:free -> :participant
# Not approved
_ -> 0
_ -> :not_approved
end
end