Fixed key/location
This commit is contained in:
parent
9575619d3b
commit
807997f239
@ -73,8 +73,13 @@ class S3CompleteMixin(View):
|
||||
self.object = self.get_object()
|
||||
|
||||
if self.always_set or not self.object.key:
|
||||
uri = urlparse(request.GET['location'])
|
||||
self.object.key = uri.path[1:]
|
||||
if 'location' in request.GET:
|
||||
uri = urlparse(request.GET['location'])
|
||||
self.object.key = uri.path[1:]
|
||||
elif 'key' in request.GET:
|
||||
self.object.key = request.GET['key']
|
||||
else:
|
||||
raise KeyError("No key or location found")
|
||||
self.object.save()
|
||||
|
||||
return super().get(request, *args, **kwargs)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user