addons-server/migrations/597-theme-description.py

16 строки
423 B
Python
Исходник Обычный вид История

#!/usr/bin/env python
from addons.models import Addon
import amo
def run():
"""
Migrate summary to description field for a handful of themes after
getpersonas migration.
"""
addons = Addon.objects.filter(type=amo.ADDON_PERSONA,
description__isnull=True, summary__isnull=False)
for addon in addons:
addon.update(description=addon.summary, summary='')