Commits

Anonymous committed fbc1651

fixed bug: get_media_url() doesn't work correctly with django 1.3 alpha 1 because in django.conf.global_settings.py the STATIC_URL is set to None by default.

Comments (0)

Files changed (1)

admin_tools/utils.py

     """
     Returns the django admin tools media URL.
     """
-    return getattr(
-        settings,
-        'ADMIN_TOOLS_MEDIA_URL',
-        getattr(settings, 'STATIC_URL', settings.MEDIA_URL)
-    ).rstrip('/')
+    media_url = getattr(settings, 'ADMIN_TOOLS_MEDIA_URL', None)
+    if media_url == None:
+        media_url = getattr(settings, 'STATIC_URL', None)
+    if media_url == None:
+        media_url = getattr(settings, 'MEDIA_URL')
+    return media_url.rstrip('/')