From 16d192db2432f71d0f292d8ad17db74bae6dcd38 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 19 Apr 2021 12:41:40 +0200 Subject: [PATCH] Trim addresses when exporting them Signed-off-by: Thomas Citharel --- lib/mobilizon/addresses/address.ex | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/mobilizon/addresses/address.ex b/lib/mobilizon/addresses/address.ex index 5706748a6..c2d71bb20 100644 --- a/lib/mobilizon/addresses/address.ex +++ b/lib/mobilizon/addresses/address.ex @@ -83,8 +83,10 @@ defmodule Mobilizon.Addresses.Address do def representation(nil), do: nil def representation(%__MODULE__{} = address) do - "#{address.street} #{address.postal_code} #{address.locality} #{address.region} #{ - address.country - }" + String.trim( + "#{address.street} #{address.postal_code} #{address.locality} #{address.region} #{ + address.country + }" + ) end end