forked from 0x2620/pandora
make moving files more reliable
This commit is contained in:
parent
41ef8f13a7
commit
d2f04319a5
1 changed files with 3 additions and 5 deletions
|
@ -409,11 +409,9 @@ class Item(models.Model):
|
||||||
l.remove(self)
|
l.remove(self)
|
||||||
if l.items.filter(id=other.id).count() == 0:
|
if l.items.filter(id=other.id).count() == 0:
|
||||||
l.add(other)
|
l.add(other)
|
||||||
#FIXME: should this really happen for annotations?
|
self.annotations.all().update(item=other, public_id=None)
|
||||||
for a in self.annotations.all():
|
for a in other.annotations.filter(public_id=None).order_by('id'):
|
||||||
a.item = other
|
a.set_public_id()
|
||||||
a.public_id = None
|
|
||||||
a.save()
|
|
||||||
|
|
||||||
if hasattr(self, 'files'):
|
if hasattr(self, 'files'):
|
||||||
for f in self.files.all():
|
for f in self.files.all():
|
||||||
|
|
Loading…
Reference in a new issue