diff --git a/pandora/item/models.py b/pandora/item/models.py index 99f062b9..a5f44aca 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -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,7 +296,10 @@ 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)): - p = tasks.update_poster.delay(self.public_id) + if is_task: + tasks.update_poster(self.public_id) + else: + p = tasks.update_poster.delay(self.public_id) return p def update_external(self): diff --git a/pandora/item/views.py b/pandora/item/views.py index 7eff652a..a84a0720 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -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)