modify migration to handle situation in which a subject does not exist (e.g., Selenium tests)

pull/1/head
Raymond Yee 2015-01-11 12:44:31 -08:00
parent 684c518324
commit 134988f082
1 changed files with 6 additions and 3 deletions

View File

@ -13,9 +13,12 @@ class Migration(SchemaMigration):
self.gf('django.db.models.fields.BooleanField')(default=True),
keep_default=False)
for kw in INVISIBLE:
sub = orm.Subject.objects.get(name=kw)
sub.is_visible = False
sub.save()
try:
sub = orm.Subject.objects.get(name=kw)
sub.is_visible = False
sub.save()
except:
pass
def backwards(self, orm):