mirror of
https://github.com/wassname/flask-cloudy.git
synced 2026-08-20 12:20:28 +08:00
if obj => if obj is not None
The file server was returning a 404 on every file because bool(obj)==False. This is because python falls back on __len__ which is set to zero for most files. This fixes it.
This commit is contained in:
+2
-2
@@ -347,7 +347,7 @@ class Storage(object):
|
||||
@app.route(url, endpoint=SERVER_ENDPOINT)
|
||||
def files_server(object_name):
|
||||
obj = self.get(object_name)
|
||||
if obj:
|
||||
if obj is not None:
|
||||
dl = request.args.get("dl")
|
||||
name = request.args.get("name", obj.name)
|
||||
|
||||
@@ -575,4 +575,4 @@ class Object(object):
|
||||
:return:
|
||||
"""
|
||||
warnings.warn("DEPRECATED: flask_cloudy.Object.short_url has been deprecated, use flask_cloudy.Object.url or flask_cloudy.Object.full_url")
|
||||
return self.get_url()
|
||||
return self.get_url()
|
||||
|
||||
Reference in New Issue
Block a user