dont call item.save() in poster update, this causes data loss
This commit is contained in:
parent
558306a629
commit
931aeaf130
3 changed files with 5 additions and 2 deletions
|
@ -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):
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue