diff --git a/fastapi_user_auth/utils/sqlachemy_adapter.py b/fastapi_user_auth/utils/sqlachemy_adapter.py index 5675a1b..eb9475d 100644 --- a/fastapi_user_auth/utils/sqlachemy_adapter.py +++ b/fastapi_user_auth/utils/sqlachemy_adapter.py @@ -147,7 +147,7 @@ async def add_policies(self, sec: str, ptype: str, rules: Iterable[Tuple[str]]) """adds a policy rules to the storage.""" values = [] for rule in rules: - values.append(self.parse_rule(ptype, rule).dict()) + values.append(self.parse_rule(ptype, rule).dict(exclude={"id"})) if not values: return await self.db.async_execute(insert(self._db_class).values(values))