mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
fix folder deletion
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -189,9 +190,8 @@ class Transcript(BaseModel):
|
|||||||
return [participant.model_dump(mode=mode) for participant in self.participants]
|
return [participant.model_dump(mode=mode) for participant in self.participants]
|
||||||
|
|
||||||
def unlink(self):
|
def unlink(self):
|
||||||
for filename in os.listdir(self.data_path):
|
if os.path.exists(self.data_path) and os.path.isdir(self.data_path):
|
||||||
if os.path.isfile(os.path.join("directory_path", filename)):
|
shutil.rmtree(self.data_path)
|
||||||
os.remove(os.path.join("directory_path", filename))
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def data_path(self):
|
def data_path(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user