Ticket #4398: 4398_newforms_admin_js_path_fix.diff

File 4398_newforms_admin_js_path_fix.diff, 848 bytes (added by Brian Rosner <brosner@…>, 17 years ago)

patch to fix #4398

  • branches/newforms-admin/django/contrib/admin/options.py

     
    216216                js.append('js/admin/CollapsedFieldsets.js')
    217217                break
    218218        prefix = settings.ADMIN_MEDIA_PREFIX
    219         return ['%s%s' % (prefix, url) for url in js]
     219        js_urls = []
     220        for url in js:
     221            if url.startswith('http://') or url.startswith('/'):
     222                js_urls.append(url)
     223            else:
     224                js_urls.append('%s%s' % (prefix, url))
     225        return js_urls
    220226
    221227    def javascript_add(self, request):
    222228        return self.javascript(request, self.fieldsets_add(request))
Back to Top