Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow Filepicker JS version to be configured

Filepicker JS version can now be configured
using FILEPICKER_JS_VERSION. Version 0 is
default.

Changed the logic of INPUT_TYPE to use
getattr instead of hasattr and an if
statement.
  • Loading branch information...
commit a103968558963c032db7294ed15560429861550d 1 parent 32116cf
@jonathan3 jonathan3 authored
Showing with 2 additions and 6 deletions.
  1. +2 −6 django_filepicker/widgets.py
View
8 django_filepicker/widgets.py
@@ -2,14 +2,10 @@
from django.forms import widgets
#JS_URL is the url to the filepicker.io javascript library
-JS_VERSION = 1
+JS_VERSION = getattr(settings, "FILEPICKER_JS_VERSION", 0)
JS_URL = "//api.filepicker.io/v%d/filepicker.js" % (JS_VERSION)
-if hasattr(settings, 'FILEPICKER_INPUT_TYPE'):
- INPUT_TYPE = settings.FILEPICKER_INPUT_TYPE
-else:
- INPUT_TYPE = 'filepicker-dragdrop'
-
+INPUT_TYPE = getattr(settings, "FILEPICKER_INPUT_TYPE", "filepicker-dragdrop")
class FPFileWidget(widgets.Input):
input_type = INPUT_TYPE

0 comments on commit a103968

Please sign in to comment.
Something went wrong with that request. Please try again.