Send email notifications when a participation is approved/rejected
Also handles participant status :rejected instead of deleting the participation Closes #164 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
defmodule Mobilizon.Storage.Repo.Migrations.AddRejectedToParticipantRole do
|
||||
use Ecto.Migration
|
||||
alias Mobilizon.Storage.Repo
|
||||
alias Mobilizon.Events.Participant
|
||||
alias Mobilizon.Events.ParticipantRole
|
||||
import Ecto.Query
|
||||
|
||||
@disable_ddl_transaction true
|
||||
|
||||
def up do
|
||||
Ecto.Migration.execute(
|
||||
"ALTER TYPE #{ParticipantRole.type()} ADD VALUE IF NOT EXISTS 'rejected'"
|
||||
)
|
||||
end
|
||||
|
||||
def down do
|
||||
Participant
|
||||
|> where(role: "rejected")
|
||||
|> Repo.delete_all()
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user