@@ -18,6 +18,8 @@ def save(self, model, path=""):
18
18
if chunk is not None :
19
19
path = path .strip ("/" )
20
20
21
+ self .run_pre_save_hook (model = model , path = path )
22
+
21
23
if "type" not in model :
22
24
raise web .HTTPError (400 , u"No file type provided" )
23
25
if model ["type" ] != "file" :
@@ -31,11 +33,10 @@ def save(self, model, path=""):
31
33
raise web .HTTPError (400 , u"No file content provided" )
32
34
33
35
os_path = self ._get_os_path (path )
36
+ self .log .debug ("Saving %s" , os_path )
34
37
35
38
try :
36
39
if chunk == 1 :
37
- self .log .debug ("Saving %s" , os_path )
38
- self .run_pre_save_hook (model = model , path = path )
39
40
super (LargeFileManager , self )._save_file (
40
41
os_path , model ["content" ], model .get ("format" )
41
42
)
@@ -90,6 +91,10 @@ async def save(self, model, path=""):
90
91
if chunk is not None :
91
92
path = path .strip ("/" )
92
93
94
+ os_path = self ._get_os_path (path )
95
+ self .log .debug ("Saving %s" , os_path )
96
+ self .run_pre_save_hook (model = model , path = path )
97
+
93
98
if "type" not in model :
94
99
raise web .HTTPError (400 , u"No file type provided" )
95
100
if model ["type" ] != "file" :
@@ -102,12 +107,8 @@ async def save(self, model, path=""):
102
107
if "content" not in model and model ["type" ] != "directory" :
103
108
raise web .HTTPError (400 , u"No file content provided" )
104
109
105
- os_path = self ._get_os_path (path )
106
-
107
110
try :
108
111
if chunk == 1 :
109
- self .log .debug ("Saving %s" , os_path )
110
- self .run_pre_save_hook (model = model , path = path )
111
112
await super (AsyncLargeFileManager , self )._save_file (
112
113
os_path , model ["content" ], model .get ("format" )
113
114
)
0 commit comments