from django.core.management.color import color_style
from django.db import transaction
-from slughifi import slughifi
from catalogue.models import Book
force = options.get('force')
guess = options.get('guess')
dry_run = options.get('dry_run')
- new_slug = options.get('new_slug')
- new_title = options.get('new_title')
+ new_slug = options.get('new_slug').decode('utf-8')
+ new_title = options.get('new_title').decode('utf-8')
verbose = options.get('verbose')
if guess:
return
# Start transaction management.
- transaction.commit_unless_managed()
transaction.enter_transaction_management()
- transaction.managed(True)
books = [Book.objects.get(slug=slug) for slug in slugs]
common_slug = common_prefix(slugs)