Skip to content

Commit

Permalink
basemodel: ignore cls_name attribute
Browse files Browse the repository at this point in the history
when initializing object from it's dir values, it contains cls_name which is a property not an attribute leading to runtime errors

Signed-off-by: ZorEl212 <[email protected]>
  • Loading branch information
ZorEl212 committed Oct 23, 2024
1 parent b2c3042 commit 4d3161f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def __init__(self, **kwargs) -> None:
for key, value in kwargs.items():
if key in ['created_at', 'updated_at']:
value = datetime.strptime(value, '%Y-%m-%dT%H:%M:%S.%f')
setattr(self, key, value)
if key != 'cls_name':
setattr(self, key, value)

@classmethod
def get_cls_name(cls):
Expand Down

0 comments on commit 4d3161f

Please sign in to comment.