dont call item.save() in poster update, this causes data loss

This commit is contained in:
j 2012-03-10 02:46:26 +01:00
parent 558306a629
commit 931aeaf130
3 changed files with 5 additions and 2 deletions

View file

@ -289,6 +289,7 @@ def moveFiles(request):
if Item.objects.filter(itemId=data['itemId']).count() == 1:
i = Item.objects.get(itemId=data['itemId'])
else:
data['itemId'] = data['itemId'].strip()
if len(data['itemId']) != 7:
del data['itemId']
if 'director' in data and isinstance(data['director'], basestring):

View file

@ -105,7 +105,6 @@ def get_item(info, user=None, async=False):
info['imdbId'] = itemId
item = get_item(info)
return item
try:
item = Item.objects.get(itemId=info.get('oxdbId'))
except Item.DoesNotExist:

View file

@ -43,7 +43,10 @@ def update_poster(itemId):
item = models.Item.objects.get(itemId=itemId)
item.make_poster(True)
item.make_icon()
item.save()
models.Item.objects.filter(pk=item.id).update(
poster=item.poster.name,
icon=item.icon.name
)
@task(ignore_resulsts=True, queue='default')
def update_external(itemId):