Correct default value of WEB_AUTH
authorymh <ymh.work@gmail.com>
Tue, 06 Nov 2012 17:01:10 +0100
changeset 903 ba43c842648c
parent 902 e32b7057ca48
child 904 d950c4bd48b8
Correct default value of WEB_AUTH
src/ldt/ldt/settings.py
src/ldt/ldt/utils/url.py
--- a/src/ldt/ldt/settings.py	Tue Nov 06 16:23:50 2012 +0100
+++ b/src/ldt/ldt/settings.py	Tue Nov 06 17:01:10 2012 +0100
@@ -54,7 +54,7 @@
 
 
 WEB_URL = getattr(settings, 'WEB_URL', '')
-WEB_AUTH = getattr(settings, 'WEB_AUTH', None)
+WEB_AUTH = getattr(settings, 'WEB_AUTH', {})
 BASE_URL = getattr(settings, 'BASE_URL', '')
 STATIC_URL = getattr(settings, 'STATIC_URL', '')
 MEDIA_URL = getattr(settings, 'MEDIA_URL', '')
--- a/src/ldt/ldt/utils/url.py	Tue Nov 06 16:23:50 2012 +0100
+++ b/src/ldt/ldt/utils/url.py	Tue Nov 06 17:01:10 2012 +0100
@@ -4,7 +4,7 @@
 
 def request_with_auth(url, method='GET'):
     h = httplib2.Http()
-    web_auth = getattr(settings, "WEB_AUTH", {})
+    web_auth = settings.WEB_AUTH if settings.WEB_AUTH else {}
     for key in web_auth:
         if re.search(key, url, re.IGNORECASE):
             h.add_credentials(web_auth[key].get('NAME', ''), web_auth[key].get('PASSWORD', ''), web_auth[key].get('DOMAIN', ''))