1. Carl Meyer
  2. django-adminfiles

Commits

Carl Meyer  committed 468b081 Draft

Remove unnecessary path joining; thanks unaizalakain.

  • Participants
  • Parent commits 517d778
  • Branches default

Comments (0)

Files changed (2)

File adminfiles/admin.py

View file
  • Ignore whitespace
-import posixpath
-
 from django.http import HttpResponse
 
 from django.contrib import admin
 
 from adminfiles.models import FileUpload
-from adminfiles.settings import JQUERY_URL, STATIC_URL
+from adminfiles.settings import JQUERY_URL
 from adminfiles.listeners import register_listeners
 
 class FileUploadAdmin(admin.ModelAdmin):
     prepopulated_fields = {'slug': ('title',)}
 # uncomment for snipshot photo editing feature
 #    class Media:
-#        js = (JQUERY_URL, posixpath.join(STATIC_URL,
-#                                         'photo-edit.js'))
+#        js = (JQUERY_URL, 'photo-edit.js')
     def response_change(self, request, obj):
         if request.POST.has_key("_popup"):
             return HttpResponse('<script type="text/javascript">'
         return field
 
     class Media:
-        js = [JQUERY_URL, posixpath.join(STATIC_URL, 'adminfiles/model.js')]
+        js = [JQUERY_URL, 'adminfiles/model.js']
 
 admin.site.register(FileUpload, FileUploadAdmin)

File adminfiles/settings.py

View file
  • Ignore whitespace
 JQUERY_URL = getattr(settings, 'JQUERY_URL',
                      'http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js')
 
-STATIC_URL = settings.STATIC_URL
-
 if JQUERY_URL and not ((':' in JQUERY_URL) or (JQUERY_URL.startswith('/'))):
-    JQUERY_URL = posixpath.join(STATIC_URL, JQUERY_URL)
+    JQUERY_URL = posixpath.join(settings.STATIC_URL, JQUERY_URL)
 
 ADMINFILES_UPLOAD_TO = getattr(settings, 'ADMINFILES_UPLOAD_TO', 'adminfiles')