Skip to content

Commit

Permalink
ZEP-25 : correction mineure de la commande de migration
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavi committed May 13, 2016
1 parent 0e8c8a9 commit dbb38a1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions zds/tutorialv2/management/commands/migrate_to_zep25.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ def categories_to_tags(self):
for content in contents:
categories = content.subcategory.all()
for cat in categories:
cat_name = cat.title.strip().lower()
# do not add "autre" tag (useless)
if cat.strip() != 'autre':
current_tag, created = Tag.objects.get_or_create(title=cat.lower())
if cat_name != 'autre':
current_tag, created = Tag.objects.get_or_create(title=cat_name)
content.tags.add(current_tag)
if created:
self.stdout.write('[ZEP-25] : Tag "{}" added'.format(current_tag))
Expand Down

0 comments on commit dbb38a1

Please sign in to comment.