From 5de22f91e22109da9e2169928dc744acd94b7299 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 5 Jan 2024 16:15:15 +0100 Subject: [PATCH] fix(backend): avoid duplicating locality and region if they are the same An example is Paris where both locality and region are named "Paris" Signed-off-by: Thomas Citharel --- lib/service/address/address.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/service/address/address.ex b/lib/service/address/address.ex index 12f7a396e..0f58ad6c4 100644 --- a/lib/service/address/address.ex +++ b/lib/service/address/address.ex @@ -85,7 +85,7 @@ defmodule Mobilizon.Service.Address do defined?(street) -> if defined?(locality), do: "#{street} (#{locality})", else: street - defined?(locality) -> + defined?(locality) and locality != region -> "#{locality}, #{region}, #{country}" defined?(region) ->