removes unecessary dependence on existence of username for User migration01, + fix whitespace issues
This commit is contained in:
parent
e36ecab093
commit
17bb7c388b
@ -54,16 +54,15 @@ class UserMigration(DocumentMigration):
|
|||||||
"""
|
"""
|
||||||
User can elaborate profile with home page and biography
|
User can elaborate profile with home page and biography
|
||||||
"""
|
"""
|
||||||
self.target = {'username': {'$exists': True}, 'url': {'$exists': False},
|
self.target = {'url': {'$exists': False},
|
||||||
'bio': {'$exists': False}}
|
'bio': {'$exists': False}}
|
||||||
if not self.status:
|
if not self.status:
|
||||||
for doc in self.collection.find(self.target):
|
for doc in self.collection.find(self.target):
|
||||||
self.update = {
|
self.update = {
|
||||||
'$set': {
|
'$set': {'url': '',
|
||||||
'url': '',
|
'bio': ''}}
|
||||||
'bio': ''}}
|
|
||||||
self.collection.update(
|
self.collection.update(
|
||||||
self.target, self.update, multi=True, safe=True)
|
self.target, self.update, multi=True, safe=True)
|
||||||
|
|
||||||
|
|
||||||
MIGRATE_CLASSES = ['MediaEntry','User']
|
MIGRATE_CLASSES = ['MediaEntry', 'User']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user