Fixed the long file name bug

This commit is contained in:
Ali Parlakci
2018-07-10 01:44:28 +03:00
parent 4e8e59f527
commit 2e15dacaeb

View File

@@ -309,7 +309,13 @@ class Self:
if Path.is_file(fileDir):
raise FileAlreadyExistsError
self.writeToFile(fileDir,post)
try:
self.writeToFile(fileDir,post)
except FileNotFoundError:
fileDir = post['postId']+".md"
fileDir = directory / fileDir
self.writeToFile(fileDir,post)
@staticmethod
def writeToFile(directory,post):