Skip to content

Commit eabe94c

Browse files
committed
Refactor fingerprint generation in insert_many method of State model
- Updated the insert_many method to always generate fingerprints for all states, removing the conditional check for does_unites. This change simplifies the logic and ensures consistent fingerprint generation for all state insertions.
1 parent a37c934 commit eabe94c

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

state-manager/app/models/db/state.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,8 @@ async def insert_many(cls, documents: list["State"]) -> InsertManyResult:
5050
"""Override insert_many to ensure fingerprints are generated before insertion."""
5151
# Generate fingerprints for states that need them
5252
for state in documents:
53-
if state.does_unites:
54-
state._generate_fingerprint()
53+
state._generate_fingerprint()
5554

56-
# Call the parent class insert_many method
5755
return await super().insert_many(documents) # type: ignore
5856

5957
class Settings:

0 commit comments

Comments
 (0)