fix buggy sort_key migration
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 5 Jan 2011 13:00:59 +0000 (14:00 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 5 Jan 2011 13:00:59 +0000 (14:00 +0100)
apps/catalogue/migrations/0004_auto__chg_field_tag_sort_key.py

index b4eac04..557158a 100644 (file)
@@ -12,7 +12,7 @@ class Migration(SchemaMigration):
         db.alter_column('catalogue_tag', 'sort_key', self.gf('django.db.models.fields.CharField')(max_length=120))
 
         if not db.dry_run:
         db.alter_column('catalogue_tag', 'sort_key', self.gf('django.db.models.fields.CharField')(max_length=120))
 
         if not db.dry_run:
-            for tag in orm.Tag.objects.exclude(category=('set', 'author')):
+            for tag in orm.Tag.objects.exclude(category__in=('set', 'author')):
                 tag.sort_key = tag.name.lower()
                 tag.save()
             for tag in orm.Tag.objects.filter(category='author'):
                 tag.sort_key = tag.name.lower()
                 tag.save()
             for tag in orm.Tag.objects.filter(category='author'):