dont change path if there are no instances left
This commit is contained in:
parent
5beba72d39
commit
aa40c39a81
1 changed files with 1 additions and 7 deletions
|
@ -323,13 +323,7 @@ class File(models.Model):
|
||||||
instance = self.get_instance()
|
instance = self.get_instance()
|
||||||
if instance:
|
if instance:
|
||||||
return instance.path
|
return instance.path
|
||||||
if self.item:
|
return self.path
|
||||||
name = self.item.get('title', 'Untitled')
|
|
||||||
name = re.sub(r'[:\\/]', '_', name)
|
|
||||||
if not name:
|
|
||||||
name = 'Untitled'
|
|
||||||
ext = '.unknown'
|
|
||||||
return name + ext
|
|
||||||
|
|
||||||
def delete_file(sender, **kwargs):
|
def delete_file(sender, **kwargs):
|
||||||
f = kwargs['instance']
|
f = kwargs['instance']
|
||||||
|
|
Loading…
Reference in a new issue