available files are not wanted
This commit is contained in:
parent
765e1cd82c
commit
6de05d4c9d
1 changed files with 6 additions and 3 deletions
|
@ -1104,11 +1104,14 @@ class Item(models.Model):
|
||||||
wanted = []
|
wanted = []
|
||||||
for s in self.sets():
|
for s in self.sets():
|
||||||
if s.filter(selected=False).count() != 0:
|
if s.filter(selected=False).count() != 0:
|
||||||
wanted += [i.id for i in s]
|
wanted += [f.id for f in s if not f.available]
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
self.files.filter(id__in=wanted).update(wanted=True)
|
qs = self.files.all()
|
||||||
self.files.exclude(id__in=wanted).update(wanted=False)
|
if wanted:
|
||||||
|
self.files.filter(id__in=wanted).update(wanted=True)
|
||||||
|
qs = qs.exclude(id__in=wanted)
|
||||||
|
qs.update(wanted=False)
|
||||||
|
|
||||||
def update_selected(self):
|
def update_selected(self):
|
||||||
sets = self.sets()
|
sets = self.sets()
|
||||||
|
|
Loading…
Reference in a new issue