Ticket #1099: admin_media_prefix_allow_absolute_paths.diff
File admin_media_prefix_allow_absolute_paths.diff, 842 bytes (added by , 18 years ago) |
---|
-
django/contrib/admin/templatetags/admin_modify.py
18 18 return '_'.join([s.lower() for s in word_re.findall(name)[:-1]]) 19 19 20 20 def include_admin_script(script_path): 21 return '<script type="text/javascript" src="%s%s"></script>' % (settings.ADMIN_MEDIA_PREFIX, script_path) 21 from urlparse import urljoin 22 if not re.search(r'^(?:https?://|/)', script_path): 23 script_path = urljoin(settings.ADMIN_MEDIA_PREFIX, script_path) 24 return '<script type="text/javascript" src="%s"></script>' % script_path 22 25 include_admin_script = register.simple_tag(include_admin_script) 23 26 24 27 def submit_row(context):