Correcting model update
This commit is contained in:
@@ -29,7 +29,7 @@ class Account(AccountBaseId, table=True):
|
||||
@classmethod
|
||||
def list_accounts(cls):
|
||||
return cls.list().where(
|
||||
Account.type.not_in_([v.value for v in CategoryType])
|
||||
Account.type.not_in([v.value for v in CategoryType])
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@@ -44,7 +44,7 @@ class Account(AccountBaseId, table=True):
|
||||
|
||||
@classmethod
|
||||
def update(cls, session, account_db, account_data):
|
||||
account_db.sqlmodel_update(account_data)
|
||||
account_db.sqlmodel_update(cls.model_validate(account_data))
|
||||
session.add(account_db)
|
||||
session.commit()
|
||||
session.refresh(account_db)
|
||||
|
||||
Reference in New Issue
Block a user