Merge pull request #10870 from eviljeff/10869-delete-lwt-command
This commit is contained in:
Коммит
c92c71be88
|
@ -10,6 +10,7 @@ from olympia.addons.tasks import (
|
|||
add_dynamic_theme_tag,
|
||||
add_firefox57_tag,
|
||||
bump_appver_for_legacy_addons,
|
||||
delete_addons,
|
||||
disable_legacy_files,
|
||||
extract_colors_from_static_themes,
|
||||
find_inconsistencies_between_es_and_db,
|
||||
|
@ -68,6 +69,12 @@ tasks = {
|
|||
Q(type=amo.ADDON_PERSONA, status=amo.STATUS_PUBLIC)
|
||||
]
|
||||
},
|
||||
'delete_lwt': {
|
||||
'method': delete_addons,
|
||||
'qs': [
|
||||
Q(type=amo.ADDON_PERSONA)
|
||||
]
|
||||
},
|
||||
'recreate_previews': {
|
||||
'method': recreate_previews,
|
||||
'qs': [
|
||||
|
|
|
@ -955,3 +955,13 @@ def recreate_theme_previews(addon_ids, **kw):
|
|||
generate_static_theme_preview(theme_data, version.id)
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
|
||||
@task
|
||||
@use_primary_db
|
||||
def delete_addons(addon_ids, **kw):
|
||||
log.info('[%s@%s] Deleting addons starting at id: %s...'
|
||||
% (len(addon_ids), delete_addons.rate_limit, addon_ids[0]))
|
||||
addons = Addon.objects.filter(pk__in=addon_ids).no_transforms()
|
||||
for addon in addons:
|
||||
addon.delete(send_delete_email=False)
|
||||
|
|
Загрузка…
Ссылка в новой задаче