From 59051a23f01eb49ed6fe6975991730021ac169ac Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Wed, 13 Jul 2011 22:32:51 -0500 Subject: [PATCH] Duplicate migration numbers not allowed, bro --- mediagoblin/db/util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mediagoblin/db/util.py b/mediagoblin/db/util.py index 3e52d8ce..0cdbd5c4 100644 --- a/mediagoblin/db/util.py +++ b/mediagoblin/db/util.py @@ -140,6 +140,8 @@ 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), \ + "Duplicate migration numbers detected! That's not allowed!" self.migration_number = migration_number self.migration_registry = migration_registry -- 2.25.1