Only migrate to description_html if description also exists.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Tue, 21 Jun 2011 02:02:46 +0000 (21:02 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Tue, 21 Jun 2011 02:02:46 +0000 (21:02 -0500)
mediagoblin/db/migrations.py

index b87988fe5e5ba30d9a09612ba67e6cd8a2c978f0..aacbf079337a64e414bc7c788146a7dc91b08343 100644 (file)
@@ -40,7 +40,8 @@ class MediaEntryMigration(DocumentMigration):
         Now that we can have rich descriptions via Markdown, we should
         update all existing entries to record the rich description versions.
         """
-        self.target = {'description_html': {'$exists': False}}
+        self.target = {'description_html': {'$exists': False},
+                       'description': {'$exists': True}}
 
         if not self.status:
             for doc in self.collection.find(self.target):