Skip to content

Commit

Permalink
Fix variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
SeoulSKY committed Jan 17, 2024
1 parent b77b65f commit 6208363
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mongo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
client = AsyncIOMotorClient(host="mongo") if os.getenv("DOCKER") else AsyncIOMotorClient()
db: AsyncIOMotorDatabase = client.get_database(DATABASE_NAME)

T = TypeVar("T", bound="Collection")
T = TypeVar("T", bound="Document")


class Document: # pylint: disable=too-few-public-methods
Expand All @@ -39,11 +39,11 @@ def _from_dict(child_class: Type[T], source: dict) -> T:
:return: The new document
"""

collection = child_class()
document = child_class()
for key, value in source.items():
setattr(collection, key, value)
setattr(document, key, value)

return collection
return document

def to_dict(self) -> dict:
"""
Expand Down

0 comments on commit 6208363

Please sign in to comment.