From d12fb7db68de7ed2d8c5ed3c5f27235d286f59bf Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 23 Apr 2024 17:25:53 +1000 Subject: [PATCH] fix(config): fix duplicate migration logic This was checking a `Version` object against a `MigrationEntry`, but what we want is to check the version object against `MigrationEntry.from_version` --- invokeai/app/services/config/config_migrate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invokeai/app/services/config/config_migrate.py b/invokeai/app/services/config/config_migrate.py index 6cdbca7558..5402555a47 100644 --- a/invokeai/app/services/config/config_migrate.py +++ b/invokeai/app/services/config/config_migrate.py @@ -36,7 +36,7 @@ class ConfigMigrator: """Define a decorator which registers the migration between two versions.""" def decorator(function: MigrationFunction) -> MigrationFunction: - if from_version in cls._migrations: + if any(from_version == m.from_version for m in cls._migrations): raise ValueError( f"function {function.__name__} is trying to register a migration for version {str(from_version)}, but this migration has already been registered." )