Only migrate to description_html if description also exists.

This commit is contained in:
Christopher Allan Webber 2011-06-20 21:02:46 -05:00
parent 8268884653
commit a2c37d0a78

View File

@ -40,7 +40,8 @@ class MediaEntryMigration(DocumentMigration):
Now that we can have rich descriptions via Markdown, we should Now that we can have rich descriptions via Markdown, we should
update all existing entries to record the rich description versions. 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: if not self.status:
for doc in self.collection.find(self.target): for doc in self.collection.find(self.target):