mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 00:23:07 +00:00
Fix broken deletion
This commit is contained in:
@@ -96,6 +96,10 @@ class CustomDataWrapper:
|
||||
if not CustomDataWrapper.use_db:
|
||||
CustomDataWrapper.custom_data = []
|
||||
|
||||
@staticmethod
|
||||
def delete_custom_data(trade_id: int) -> None:
|
||||
_CustomData.session.query(_CustomData).filter(_CustomData.ft_trade_id == trade_id).delete()
|
||||
|
||||
@staticmethod
|
||||
def get_custom_data(key: Optional[str] = None,
|
||||
trade_id: Optional[int] = None) -> List[_CustomData]:
|
||||
|
||||
@@ -1600,8 +1600,7 @@ class Trade(ModelBase, LocalTrade):
|
||||
for order in self.orders:
|
||||
Order.session.delete(order)
|
||||
|
||||
for entry in self.custom_data:
|
||||
_CustomData.session.delete(entry)
|
||||
CustomDataWrapper.delete_custom_data(trade_id=self.id)
|
||||
|
||||
_CustomData.session.commit()
|
||||
Trade.session.delete(self)
|
||||
|
||||
Reference in New Issue
Block a user