diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-11-13 20:23:26 -0600 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-11-13 20:23:26 -0600 |
commit | ee91c2b88d1a42b9d15d34d2c081cd8394649041 (patch) | |
tree | 01a75b958b2814763a0b219145bbe284d1d04931 /mediagoblin/db/util.py | |
parent | 4671fda345394dad9ca4278b1cf7b2cdf7d2b4ee (diff) | |
parent | 285ffeddf3542201b83072d3be544c85e9c487c2 (diff) | |
download | mediagoblin-ee91c2b88d1a42b9d15d34d2c081cd8394649041.tar.lz mediagoblin-ee91c2b88d1a42b9d15d34d2c081cd8394649041.tar.xz mediagoblin-ee91c2b88d1a42b9d15d34d2c081cd8394649041.zip |
Merge remote-tracking branch 'remotes/nyergler/pep8-ification'
Conflicts:
mediagoblin/db/migrations.py
mediagoblin/db/models.py
mediagoblin/user_pages/views.py
mediagoblin/util.py
Diffstat (limited to 'mediagoblin/db/util.py')
-rw-r--r-- | mediagoblin/db/util.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mediagoblin/db/util.py b/mediagoblin/db/util.py index 84a6cbce..52e97f6d 100644 --- a/mediagoblin/db/util.py +++ b/mediagoblin/db/util.py @@ -118,11 +118,12 @@ def remove_deprecated_indexes(database, deprecated_indexes=DEPRECATED_INDEXES): ################# # The default migration registry... -# +# # Don't set this yourself! RegisterMigration will automatically fill # this with stuff via decorating methods in migrations.py -class MissingCurrentMigration(Exception): pass +class MissingCurrentMigration(Exception): + pass MIGRATIONS = {} @@ -147,7 +148,7 @@ class RegisterMigration(object): """ def __init__(self, migration_number, migration_registry=MIGRATIONS): assert migration_number > 0, "Migration number must be > 0!" - assert not migration_registry.has_key(migration_number), \ + assert migration_number not in migration_registry, \ "Duplicate migration numbers detected! That's not allowed!" self.migration_number = migration_number |