adds accommmodations for migration of fields in User: bio and url
This commit is contained in:
parent
78c0744077
commit
e36ecab093
@ -49,5 +49,21 @@ class MediaEntryMigration(DocumentMigration):
|
|||||||
'description_html': cleaned_markdown_conversion(
|
'description_html': cleaned_markdown_conversion(
|
||||||
doc['description'])}}
|
doc['description'])}}
|
||||||
|
|
||||||
|
class UserMigration(DocumentMigration):
|
||||||
|
def allmigration01_add_bio_and_url_profile(self):
|
||||||
|
"""
|
||||||
|
User can elaborate profile with home page and biography
|
||||||
|
"""
|
||||||
|
self.target = {'username': {'$exists': True}, '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']
|
|
||||||
|
MIGRATE_CLASSES = ['MediaEntry','User']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user