File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
fast_tmp/contrib/tortoise Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,8 @@ def __init__(self, path: str):
1515 self .path = path
1616
1717 def get_file (self ):
18- from fast_tmp .conf import settings
19-
2018 if self .path is not None :
21- value = os .path .join (os .getcwd (), settings . MEDIA_PATH , self .path )
19+ value = os .path .join (os .getcwd (), self .path )
2220 return UploadFile (filename = value )
2321 return None
2422
@@ -29,19 +27,12 @@ def __str__(self):
2927 return self .path
3028
3129 def get_static_path (self ):
32- from fast_tmp .conf import settings
33-
34- return "/" + "/" .join ([settings .MEDIA_ROOT , self .path ])
30+ return self .path
3531
3632 @classmethod
3733 def from_static_path (cls , path : str ):
38- from fast_tmp .conf import settings
39-
4034 if not path :
4135 return None
42- if path .startswith ("/" + settings .MEDIA_ROOT ): # 去除静态头
43- header_len = len (settings .MEDIA_ROOT ) + 2
44- path = path [header_len :]
4536 return cls (path )
4637
4738 def __len__ (self ):
You can’t perform that action at this time.
0 commit comments