Make sure all these strings in db/util.py are unicode
This commit is contained in:
parent
77ffe9be58
commit
8569533f21
@ -193,17 +193,17 @@ class MigrationManager(object):
|
|||||||
Set the migration in the database to migration_number
|
Set the migration in the database to migration_number
|
||||||
"""
|
"""
|
||||||
# Add the mediagoblin migration if necessary
|
# Add the mediagoblin migration if necessary
|
||||||
self.database['app_metadata'].update(
|
self.database[u'app_metadata'].update(
|
||||||
{'_id': 'mediagoblin'},
|
{u'_id': u'mediagoblin'},
|
||||||
{'$set': {'current_migration': migration_number}},
|
{u'$set': {u'current_migration': migration_number}},
|
||||||
upsert=True)
|
upsert=True)
|
||||||
|
|
||||||
def database_current_migration(self, install_if_missing=False):
|
def database_current_migration(self, install_if_missing=False):
|
||||||
"""
|
"""
|
||||||
Return the current migration in the database.
|
Return the current migration in the database.
|
||||||
"""
|
"""
|
||||||
mgoblin_metadata = self.database['app_metadata'].find_one(
|
mgoblin_metadata = self.database[u'app_metadata'].find_one(
|
||||||
{'_id': 'mediagoblin'})
|
{u'_id': u'mediagoblin'})
|
||||||
if not mgoblin_metadata:
|
if not mgoblin_metadata:
|
||||||
if install_if_missing:
|
if install_if_missing:
|
||||||
latest_migration = self.latest_migration()
|
latest_migration = self.latest_migration()
|
||||||
@ -212,7 +212,7 @@ class MigrationManager(object):
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
return mgoblin_metadata['current_migration']
|
return mgoblin_metadata[u'current_migration']
|
||||||
|
|
||||||
def database_at_latest_migration(self):
|
def database_at_latest_migration(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user