diff --git a/context_processors.py b/context_processors.py index 78aea92..fbbebf7 100644 --- a/context_processors.py +++ b/context_processors.py @@ -15,15 +15,18 @@ #querry the Domain object try: c = Client('http://localhost:8001/3.0', API_USER, API_PASS) - d = c.get_domain(None,web_host) - #workaround LP:802971 - domainname= d.email_host - for list in c.lists: - if list.host_name == domainname: - domain_lists.append(list) - except HTTPError, e: - domain_lists = c.lists - message = str(e.code) + _(" - Accesing from an unregistered Domain - showing all lists") + try: + d = c.get_domain(None,web_host) + #workaround LP:802971 + domainname= d.email_host + for list in c.lists: + if list.host_name == domainname: + domain_lists.append(list) + except HTTPError, e: + domain_lists = c.lists + message = str(e.code) + _(" - Accesing from an unregistered Domain - showing all lists") + except AttributeError, e: + message="REST API not found / Offline" #return a Dict with the key used in templates return {"lists":domain_lists, "message":message} diff --git a/views.py b/views.py index 995eea5..afac6e8 100644 --- a/views.py +++ b/views.py @@ -97,7 +97,7 @@ message=e else: try: - c = Client('http://localhost:8002/3.0', API_USER, API_PASS) + c = Client('http://localhost:8001/3.0', API_USER, API_PASS) existing_domains = c.domains except AttributeError, e: return render_to_response('mailman-django/errors/generic.html',