Fixes with addresses and iCalendar

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-11-05 17:49:40 +01:00
parent a46f4c058c
commit 33f7c14db6
6 changed files with 69 additions and 8 deletions

View File

@@ -187,7 +187,8 @@ defmodule Mobilizon.Events.Event do
# In case the provided addresses is an existing one
@spec put_address(Changeset.t(), map) :: Changeset.t()
defp put_address(%Changeset{} = changeset, %{physical_address: %{id: id} = _physical_address}) when not is_nil(id) do
defp put_address(%Changeset{} = changeset, %{physical_address: %{id: id} = _physical_address})
when not is_nil(id) do
case Addresses.get_address(id) do
%Address{} = address ->
put_assoc(changeset, :physical_address, address)