fix:upload failure

This commit is contained in:
lan
2022-12-13 21:16:41 +08:00
parent 2d7331269c
commit b948263519
+1 -1
View File
@@ -23,7 +23,7 @@ class FileSystemStorage:
path = self.DATA_ROOT / f"upload/{now.year}/{now.month}/{now.day}/"
if not path.exists():
path.mkdir(parents=True)
text = f"{self.STATIC_URL}/{(path / f'{key}.{ext}').relative_to(self.DATA_ROOT).relative_to(self.DATA_ROOT)}"
text = f"{self.STATIC_URL}/{(path / f'{key}.{ext}').relative_to(self.DATA_ROOT)}"
return text
@staticmethod