(self, key: MigrationKey, current_app: str)
| 87 | self.graph.validate_consistency() |
| 88 | |
| 89 | def _check_key(self, key: MigrationKey, current_app: str) -> MigrationKey | None: |
| 90 | if (key.name != "__first__" and key.name != "__latest__") or key in self.graph.nodes: |
| 91 | return key |
| 92 | if key.app_label == current_app: |
| 93 | return None |
| 94 | if key.app_label in self.unmigrated_apps: |
| 95 | return None |
| 96 | if key.app_label in self.migrated_apps: |
| 97 | try: |
| 98 | if key.name == "__first__": |
| 99 | return self.graph.root_nodes(key.app_label)[0] |
| 100 | return self.graph.leaf_nodes(key.app_label)[0] |
| 101 | except IndexError as exc: |
| 102 | raise ValueError(f"Dependency on app with no migrations: {key.app_label}") from exc |
| 103 | raise ValueError(f"Dependency on unknown app: {key.app_label}") |
| 104 | |
| 105 | def _add_internal_dependencies(self, key: MigrationKey, migration: Migration) -> None: |
| 106 | for parent in migration.dependencies: |
no test coverage detected