really only put files into item with same folder not same folder prefix

This commit is contained in:
j 2013-05-28 08:45:07 +00:00
parent 5ac4f4526c
commit 0c063f1650
1 changed files with 1 additions and 1 deletions

View File

@ -180,7 +180,7 @@ class File(models.Model):
get_name_sort(name, sortname)
#add all files in one folder to same item
if self.instances.all().count():
folder = os.path.dirname(self.instances.all()[0].path)
folder = os.path.dirname(self.instances.all()[0].path) + '/'
qs = item.models.Item.objects.filter(files__instances__path__startswith=folder)
if qs.exists():
self.item = qs[0]