rename Chunk.comment to Chunk.title
[redakcja.git] / apps / catalogue / migrations / 0002_from_hg.py
index 51b1296..2a64819 100644 (file)
@@ -158,15 +158,15 @@ class Migration(DataMigration):
         try:
             hg_path = settings.WIKI_REPOSITORY_PATH
         except:
-            pass
-    
-        print 'migrate from', hg_path
-        repo = hg.repository(ui.ui(), hg_path)
-        tip = repo['tip']
-        for fname in tip:
-            if fname.startswith('.') or not fname.startswith('a'):
-                continue
-            migrate_file_from_hg(orm, fname, tip[fname])
+            print 'repository not configured, skipping'
+        else:
+            print 'migrate from', hg_path
+            repo = hg.repository(ui.ui(), hg_path)
+            tip = repo['tip']
+            for fname in tip:
+                if fname.startswith('.') or not fname.startswith('a'):
+                    continue
+                migrate_file_from_hg(orm, fname, tip[fname])
 
 
     def backwards(self, orm):
@@ -223,7 +223,7 @@ class Migration(DataMigration):
         'catalogue.chunk': {
             'Meta': {'ordering': "['number']", 'unique_together': "[['book', 'number'], ['book', 'slug']]", 'object_name': 'Chunk'},
             'book': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Book']"}),
-            'comment': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
             'creator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'created_documents'", 'null': 'True', 'to': "orm['auth.User']"}),
             'head': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['catalogue.ChunkChange']", 'null': 'True', 'blank': 'True'}),
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),