forked from potsda.mn/mobilizon
Fix for adding addresses
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
23470a010c
commit
f91f8ab926
|
@ -187,8 +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}) do
|
||||
case Addresses.get_address!(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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue