update poster inline
This commit is contained in:
parent
ed31259fdd
commit
bc123a885e
2 changed files with 7 additions and 4 deletions
|
@ -240,7 +240,7 @@ class Item(models.Model):
|
|||
return True
|
||||
return False
|
||||
|
||||
def edit(self, data):
|
||||
def edit(self, data, is_task=False):
|
||||
data = data.copy()
|
||||
# FIXME: how to map the keys to the right place to write them to?
|
||||
if 'id' in data:
|
||||
|
@ -296,6 +296,9 @@ class Item(models.Model):
|
|||
self.data[key] = ox.escape_html(data[key])
|
||||
p = self.save()
|
||||
if not settings.USE_IMDB and list(filter(lambda k: k in self.poster_keys, data)):
|
||||
if is_task:
|
||||
tasks.update_poster(self.public_id)
|
||||
else:
|
||||
p = tasks.update_poster.delay(self.public_id)
|
||||
return p
|
||||
|
||||
|
|
|
@ -558,8 +558,8 @@ def edit_item(user, item, data, is_task=False):
|
|||
user_groups = set([g.name for g in user.groups.all()])
|
||||
other_groups = list(groups - user_groups)
|
||||
data['groups'] = [g for g in data['groups'] if g in user_groups] + other_groups
|
||||
r = item.edit(data)
|
||||
if r and not is_task:
|
||||
r = item.edit(data, is_task=is_tras)
|
||||
if r:
|
||||
r.wait()
|
||||
if update_clips:
|
||||
tasks.update_clips.delay(item.public_id)
|
||||
|
|
Loading…
Reference in a new issue