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 <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2024-01-05 16:15:15 +01:00
parent 1441d35e0b
commit 5de22f91e2
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -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) ->