Merge remote branch 'refs/remotes/gullydwarf-cfdv/is315'
This commit is contained in:
@@ -50,5 +50,20 @@ class MediaEntryMigration(DocumentMigration):
|
||||
'description_html': cleaned_markdown_conversion(
|
||||
doc['description'])}}
|
||||
|
||||
|
||||
MIGRATE_CLASSES = ['MediaEntry']
|
||||
class UserMigration(DocumentMigration):
|
||||
def allmigration01_add_bio_and_url_profile(self):
|
||||
"""
|
||||
User can elaborate profile with home page and biography
|
||||
"""
|
||||
self.target = {'url': {'$exists': False},
|
||||
'bio': {'$exists': False}}
|
||||
if not self.status:
|
||||
for doc in self.collection.find(self.target):
|
||||
self.update = {
|
||||
'$set': {'url': '',
|
||||
'bio': ''}}
|
||||
self.collection.update(
|
||||
self.target, self.update, multi=True, safe=True)
|
||||
|
||||
|
||||
MIGRATE_CLASSES = ['MediaEntry', 'User']
|
||||
|
||||
@@ -46,6 +46,8 @@ class User(Document):
|
||||
'status': unicode,
|
||||
'verification_key': unicode,
|
||||
'is_admin': bool,
|
||||
'url' : unicode,
|
||||
'bio' : unicode
|
||||
}
|
||||
|
||||
required_fields = ['username', 'created', 'pw_hash', 'email']
|
||||
@@ -56,6 +58,8 @@ class User(Document):
|
||||
'status': u'needs_email_verification',
|
||||
'verification_key': lambda: unicode(uuid.uuid4()),
|
||||
'is_admin': False}
|
||||
|
||||
migration_handler = migrations.UserMigration
|
||||
|
||||
def check_login(self, password):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user