Code

Ticket #1099: admin.diff

File admin.diff, 925 bytes (added by Nebojša Đorđević - nesh <nesh@…>, 8 years ago)
Line 
1Index: /store/django/django/contrib/admin/templatetags/admin_modify.py
2===================================================================
3--- /store/django/django/contrib/admin/templatetags/admin_modify.py     (revision 1763)
4+++ /store/django/django/contrib/admin/templatetags/admin_modify.py     (working copy)
5@@ -17,7 +17,11 @@
6 
7 #@register.simple_tag
8 def include_admin_script(script_path):
9-    return '<script type="text/javascript" src="%s%s"></script>' % (ADMIN_MEDIA_PREFIX, script_path)
10+    if script_path.startswith('/'):
11+        # absolute path requested, ignore ADMIN_MEDIA_PREFIX
12+        return '<script type="text/javascript" src="%s"></script>' % script_path
13+    else:
14+        return '<script type="text/javascript" src="%s%s"></script>' % (ADMIN_MEDIA_PREFIX, script_path)
15 include_admin_script = register.simple_tag(include_admin_script)
16 
17 #@register.inclusion_tag('admin/submit_line', takes_context=True)