summaryrefslogtreecommitdiff
path: root/addons/website_customer/controllers/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/website_customer/controllers/main.py')
-rw-r--r--addons/website_customer/controllers/main.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/website_customer/controllers/main.py b/addons/website_customer/controllers/main.py
index cc29a0072a6..e7a68808a57 100644
--- a/addons/website_customer/controllers/main.py
+++ b/addons/website_customer/controllers/main.py
@@ -53,14 +53,14 @@ class WebsiteCustomer(http.Controller):
if country_id:
domain += [('country_id', '=', country_id)]
- if not any(x['country_id'][0] == country_id for x in countries):
+ if not any(x['country_id'][0] == country_id for x in countries if x['country_id']):
country = country_obj.read(cr, uid, country_id, ['name'], context)
if country:
countries.append({
'country_id_count': 0,
'country_id': (country_id, country['name'])
})
- countries.sort(key=lambda d: d['country_id'][1])
+ countries.sort(key=lambda d: d['country_id'] and d['country_id'][1])
curr_country = country_obj.browse(cr, uid, country_id, context)
countries.insert(0, {