mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
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`
This commit is contained in:
parent
5d411e446a
commit
d12fb7db68
@ -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."
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user