From c65e1d6342684b1f01d70a5a753d13efc0d84c06 Mon Sep 17 00:00:00 2001 From: Pawel Krolikowski Date: Wed, 15 Apr 2015 15:18:27 +0200 Subject: [PATCH] Add support for functool.partials in filename generation --- s3direct/views.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/s3direct/views.py b/s3direct/views.py index e3c0c54a..c2e30c5c 100644 --- a/s3direct/views.py +++ b/s3direct/views.py @@ -1,5 +1,4 @@ import json -from inspect import isfunction from django.http import HttpResponse from django.views.decorators.http import require_POST @@ -43,7 +42,7 @@ def get_upload_params(request): data = json.dumps({'error': 'Invalid file type (%s).' % content_type}) return HttpResponse(data, content_type="application/json", status=400) - if isfunction(key): + if hasattr(key, '__call__'): key = key(filename) else: key = '%s/${filename}' % key