diff options
author | Jef van Schendel <jefvanschendel@gmail.com> | 2011-06-21 11:22:31 +0200 |
---|---|---|
committer | Jef van Schendel <jefvanschendel@gmail.com> | 2011-06-21 11:22:31 +0200 |
commit | 4e5a55787ba16c06944ab63afa3642070b2a7b14 (patch) | |
tree | e6e2e71fbb74c15bb1b78df77caca523623e47c4 | |
parent | 2d1f91cc41aca908502ea1d18687b902a5fd90a1 (diff) | |
parent | a2c37d0a78f939ee208225840f83a90fd698aedf (diff) | |
download | mediagoblin-4e5a55787ba16c06944ab63afa3642070b2a7b14.tar.lz mediagoblin-4e5a55787ba16c06944ab63afa3642070b2a7b14.tar.xz mediagoblin-4e5a55787ba16c06944ab63afa3642070b2a7b14.zip |
Merge remote-tracking branch 'gitorious/master'
-rw-r--r-- | mediagoblin/db/migrations.py | 3 | ||||
-rw-r--r-- | mediagoblin/util.py | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/mediagoblin/db/migrations.py b/mediagoblin/db/migrations.py index b87988fe..aacbf079 100644 --- a/mediagoblin/db/migrations.py +++ b/mediagoblin/db/migrations.py @@ -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): diff --git a/mediagoblin/util.py b/mediagoblin/util.py index 0e43a1f5..e964324f 100644 --- a/mediagoblin/util.py +++ b/mediagoblin/util.py @@ -383,6 +383,11 @@ def cleaned_markdown_conversion(text): """ Take a block of text, run it through MarkDown, and clean its HTML. """ + # Markdown will do nothing with and clean_html can do nothing with + # an empty string :) + if not text: + return u'' + return clean_html(MARKDOWN_INSTANCE.convert(text)) |