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()
|
||||
if instance:
|
||||
return instance.path
|
||||
if self.item:
|
||||
name = self.item.get('title', 'Untitled')
|
||||
name = re.sub(r'[:\\/]', '_', name)
|
||||
if not name:
|
||||
name = 'Untitled'
|
||||
ext = '.unknown'
|
||||
return name + ext
|
||||
return self.path
|
||||
|
||||
def delete_file(sender, **kwargs):
|
||||
f = kwargs['instance']
|
||||
|
|
Loading…
Reference in a new issue