mark instance as extra on update
This commit is contained in:
parent
b960a94711
commit
f06164b151
2 changed files with 3 additions and 1 deletions
|
@ -25,7 +25,6 @@ from person.models import get_name_sort
|
|||
import extract
|
||||
|
||||
|
||||
|
||||
class File(models.Model):
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
modified = models.DateTimeField(auto_now=True)
|
||||
|
|
|
@ -50,6 +50,9 @@ def update_or_create_instance(volume, f):
|
|||
setattr(instance, key, f[key])
|
||||
updated=True
|
||||
if updated:
|
||||
if instance.name.lower().startswith('extras/') or \
|
||||
instance.name.lower().startswith('versions/'):
|
||||
instance.extra = True
|
||||
instance.save()
|
||||
instance.file.save()
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue