def forwards(self, orm):
from sentry.constants import RESERVED_ORGANIZATION_SLUGS
from sentry.db.models.utils import slugify_instance
from sentry.utils.query import RangeQuerySetWrapperWithProgressBar
Organization = orm['sentry.Organization']
queryset = Organization.objects.filter(slug__isnull=True)
for org in RangeQuerySetWrapperWithProgressBar(queryset):
slugify_instance(org, org.name, RESERVED_ORGANIZATION_SLUGS)
org.save()
transaction.commit()
评论列表
文章目录