fix tasks.update_info

This commit is contained in:
j 2014-07-09 18:29:17 +00:00
parent 5005fddf69
commit f433495592

View file

@ -82,10 +82,11 @@ def update_files(user, volume, files):
@task(ignore_results=True, queue='default') @task(ignore_results=True, queue='default')
def update_info(user, info): def update_info(user, info):
user = models.User.objects.get(username=user)
files = models.File.objects.filter(oshash__in=info.keys()) files = models.File.objects.filter(oshash__in=info.keys())
for f in files: for f in files:
if not f.info: if not f.info:
f.update_info(data['info'][f.oshash], user) f.update_info(info[f.oshash], user)
f.save() f.save()
for i in Item.objects.filter(files__in=files).distinct(): for i in Item.objects.filter(files__in=files).distinct():
i.update_selected() i.update_selected()