Skip to content

Commit

Permalink
Merge pull request #42 from rabbbit/master
Browse files Browse the repository at this point in the history
Add support for functool.partials in filename generation
  • Loading branch information
bradleyg committed Apr 15, 2015
2 parents 7c0c8a7 + c65e1d6 commit b2942a0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions s3direct/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import json
from inspect import isfunction

from django.http import HttpResponse
from django.views.decorators.http import require_POST
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b2942a0

Please sign in to comment.