removes unecessary dependence on existence of username for User migration01, + fix...
authorcfdv <caldavis@gmail.com>
Tue, 21 Jun 2011 00:28:02 +0000 (19:28 -0500)
committercfdv <caldavis@gmail.com>
Tue, 21 Jun 2011 00:28:02 +0000 (19:28 -0500)
mediagoblin/db/migrations.py

index a3e7133ce34f973a4b5b6a2bb22d40d74f059cc7..29bc112fa09c93ad794d011bd5f9a42515d1f396 100644 (file)
@@ -54,16 +54,15 @@ class UserMigration(DocumentMigration):
         """
         User can elaborate profile with home page and biography
         """
-        self.target = {'username': {'$exists': True}, 'url': {'$exists': False},
-                          'bio': {'$exists': False}}
+        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': ''}}
+                    '$set': {'url': '', 
+                             'bio': ''}}
                 self.collection.update(
                     self.target, self.update, multi=True, safe=True)
                         
                         
-MIGRATE_CLASSES = ['MediaEntry','User']
+MIGRATE_CLASSES = ['MediaEntry', 'User']