Add unique constraint on event URL
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
2e631d3633
commit
9a135bb67f
@ -166,6 +166,7 @@ defmodule Mobilizon.Events.Event do
|
|||||||
|> put_picture(attrs)
|
|> put_picture(attrs)
|
||||||
|> validate_lengths()
|
|> validate_lengths()
|
||||||
|> validate_end_time()
|
|> validate_end_time()
|
||||||
|
|> unique_constraint(:url)
|
||||||
end
|
end
|
||||||
|
|
||||||
@spec validate_lengths(Changeset.t()) :: Changeset.t()
|
@spec validate_lengths(Changeset.t()) :: Changeset.t()
|
||||||
|
Loading…
Reference in New Issue
Block a user