unicode path issues, fixes #2069
This commit is contained in:
parent
13df4cd116
commit
effeb65115
1 changed files with 2 additions and 0 deletions
|
@ -410,6 +410,8 @@ class Item(models.Model):
|
||||||
|
|
||||||
def delete_files(self):
|
def delete_files(self):
|
||||||
path = os.path.join(settings.MEDIA_ROOT, self.path())
|
path = os.path.join(settings.MEDIA_ROOT, self.path())
|
||||||
|
if isinstance(path, unicode):
|
||||||
|
path = path.encode('utf-8')
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
shutil.rmtree(path)
|
shutil.rmtree(path)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue