diff --git a/backend/infrahub/core/attribute.py b/backend/infrahub/core/attribute.py index 655820cdf5..c76ce32e10 100644 --- a/backend/infrahub/core/attribute.py +++ b/backend/infrahub/core/attribute.py @@ -555,7 +555,7 @@ async def from_graphql(self, data: dict, db: InfrahubDatabase) -> bool: changed = True elif "from_pool" in data: self.from_pool = data["from_pool"] - await self.node.process_pool(db=db, attribute=self, errors=[]) + await self.node.handle_pool(db=db, attribute=self, errors=[]) changed = True if changed and self.is_from_profile: diff --git a/backend/infrahub/core/node/__init__.py b/backend/infrahub/core/node/__init__.py index 7ffbec75dd..e39338d0d6 100644 --- a/backend/infrahub/core/node/__init__.py +++ b/backend/infrahub/core/node/__init__.py @@ -215,7 +215,7 @@ async def init( return cls(**attrs) - async def process_pool(self, db: InfrahubDatabase, attribute: BaseAttribute, errors: list) -> None: + async def handle_pool(self, db: InfrahubDatabase, attribute: BaseAttribute, errors: list) -> None: """Evaluate if a resource has been requested from a pool and apply the resource This method only works on number pools, currently Integer is the only type that has the from_pool @@ -336,7 +336,7 @@ async def _process_fields(self, fields: dict, db: InfrahubDatabase) -> None: ) if not self._existing: attribute: BaseAttribute = getattr(self, attr_schema.name) - await self.process_pool(db=db, attribute=attribute, errors=errors) + await self.handle_pool(db=db, attribute=attribute, errors=errors) attribute.validate(value=attribute.value, name=attribute.name, schema=attribute.schema) except ValidationError as exc: diff --git a/changelog/4807.fixed.md b/changelog/4807.fixed.md new file mode 100644 index 0000000000..a7f2452be2 --- /dev/null +++ b/changelog/4807.fixed.md @@ -0,0 +1 @@ +Fix error when `pool` was used a relationship name