Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix displaying address

Marcin Gębalacc91c65cf711
diff --git a/saleor/dashboard/templates/dashboard/customer/detail.html b/saleor/dashboard/templates/dashboard/customer/detail.html
index c3892aaced..e420c280ae 100644
--- a/saleor/dashboard/templates/dashboard/customer/detail.html
+++ b/saleor/dashboard/templates/dashboard/customer/detail.html
@@ -7,7 +7,7 @@
{% block content %}
<div class="row">
- <h1 class="page-header"><span class="glyphicon glyphicon-user"></span> {{ customer.get_address_name }}</h1>
+ <h1 class="page-header"><span class="glyphicon glyphicon-user"></span> {{ customer }}</h1>
<div class="col-lg-8">
<div class="box">
@@ -47,8 +47,7 @@
<small>Default billing address</small>
{% with customer.default_billing_address.address as address %}
{% include 'dashboard/includes/_address.html' with address=address only %}
- <span class="glyphicon glyphicon-envelope"></span>
- {{ customer.email }}
+ <span class="glyphicon glyphicon-envelope"></span>{{ customer.email }}
{% endwith %}
</div>
diff --git a/saleor/dashboard/templates/dashboard/customer/list.html b/saleor/dashboard/templates/dashboard/customer/list.html
index 174578a959..39c1d10d21 100644
--- a/saleor/dashboard/templates/dashboard/customer/list.html
+++ b/saleor/dashboard/templates/dashboard/customer/list.html
@@ -23,7 +23,7 @@
<tr>
{% with user.default_billing_address as default_address %}
<td>
- <a href="{% url "dashboard:customer-details" pk=customer.pk %}">{{ default_address.address.name }}</a>
+ <a href="{% url "dashboard:customer-details" pk=customer.pk %}">{{ default_address.address }}</a>
</td>
<td>
{{ default_address.address.city }}, {{ default_address.address.get_country_display }}
diff --git a/saleor/dashboard/templates/dashboard/includes/_address.html b/saleor/dashboard/templates/dashboard/includes/_address.html
index 7ccdc1bbad..a2a689cb90 100644
--- a/saleor/dashboard/templates/dashboard/includes/_address.html
+++ b/saleor/dashboard/templates/dashboard/includes/_address.html
@@ -1,8 +1,12 @@
<div class="address">
- <strong>{{ address.name }}</strong>
- <div>{{ address.street_address }}</div>
+ <strong>{{ address }}</strong>
+ <div>{{ address.street_address_1 }}</div>
+ {% if address.street_address_2 %}
+ <div>{{ address.street_address_2 }}</div>
+ {% endif %}
<div>{{ address.postal_code }}</div>
<div>{{ address.city }}, {{ address.get_country_display }}</div>
- <div><span class="glyphicon glyphicon-earphone"></span>
- {{ address.phone }}</div>
+ {% if address.phone %}
+ <div><span class="glyphicon glyphicon-earphone"></span>{{ address.phone }}</div>
+ {% endif %}
</div>