aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/mongo
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/db/mongo')
-rw-r--r--mediagoblin/db/mongo/migrations.py11
-rw-r--r--mediagoblin/db/mongo/models.py2
2 files changed, 11 insertions, 2 deletions
diff --git a/mediagoblin/db/mongo/migrations.py b/mediagoblin/db/mongo/migrations.py
index 261e21a5..74a810c1 100644
--- a/mediagoblin/db/mongo/migrations.py
+++ b/mediagoblin/db/mongo/migrations.py
@@ -115,3 +115,14 @@ def mediaentry_add_license(database):
Add the 'license' field for entries that don't have it.
"""
add_table_field(database, 'media_entries', 'license', None)
+
+
+@RegisterMigration(9)
+def user_remove_bio_html(database):
+ """
+ Drop bio_html again and calculate things on the fly (and cache)
+ """
+ database['users'].update(
+ {'bio_html': {'$exists': True}},
+ {'$unset': {'bio_html': 1}},
+ multi=True)
diff --git a/mediagoblin/db/mongo/models.py b/mediagoblin/db/mongo/models.py
index 541086bc..c1282f4a 100644
--- a/mediagoblin/db/mongo/models.py
+++ b/mediagoblin/db/mongo/models.py
@@ -59,7 +59,6 @@ class User(Document, UserMixin):
- is_admin: Whether or not this user is an administrator or not.
- url: this user's personal webpage/website, if appropriate.
- bio: biography of this user (plaintext, in markdown)
- - bio_html: biography of the user converted to proper HTML.
"""
__collection__ = 'users'
use_dot_notation = True
@@ -76,7 +75,6 @@ class User(Document, UserMixin):
'is_admin': bool,
'url': unicode,
'bio': unicode, # May contain markdown
- 'bio_html': unicode, # May contain plaintext, or HTML
'fp_verification_key': unicode, # forgotten password verification key
'fp_token_expire': datetime.datetime,
}