From f81da3476716d860d89d0dd5b070bec9d4e11cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phan=20Sainl=C3=A9ger?= Date: Thu, 17 Oct 2024 12:28:17 +0200 Subject: [PATCH] [CLN] lcc_comchain_base: apply ruff --- lcc_comchain_base/models/wallet.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lcc_comchain_base/models/wallet.py b/lcc_comchain_base/models/wallet.py index b8b75cf2..1c6ab521 100644 --- a/lcc_comchain_base/models/wallet.py +++ b/lcc_comchain_base/models/wallet.py @@ -16,7 +16,9 @@ class ResPartnerBackend(models.Model): _inherit = "res.partner.backend" - type = fields.Selection(selection_add=[("comchain", "Comchain")], ondelete={'comchain': 'cascade'}) + type = fields.Selection( + selection_add=[("comchain", "Comchain")], ondelete={"comchain": "cascade"} + ) comchain_id = fields.Char(string="Address") comchain_wallet = fields.Text(string="Crypted json wallet") comchain_status = fields.Char(string="Comchain Status") @@ -65,7 +67,9 @@ def comchain_backend_accounts_data(self): if not backend_id: ## Comchain financial backend is not configured in general settings return [] - comchain_product = self.env.ref("lcc_comchain_base.product_product_comchain").sudo() + comchain_product = self.env.ref( + "lcc_comchain_base.product_product_comchain" + ).sudo() data = { "type": backend_id, "accounts": [], @@ -87,7 +91,6 @@ def comchain_backend_accounts_data(self): safe_wallet_partner = company.safe_wallet_partner_id if safe_wallet_partner: - safe_wallet_profile_info = safe_wallet_partner.lcc_profile_info() if safe_wallet_profile_info: if len(safe_wallet_profile_info) > 1: @@ -96,8 +99,10 @@ def comchain_backend_accounts_data(self): ## Safe wallet is configured and has a public profile data["safe_wallet_recipient"] = safe_wallet_profile_info[0] - monujo_backends = safe_wallet_partner.lcc_backend_ids._update_search_data( - [self.comchain_backend_id] + monujo_backends = ( + safe_wallet_partner.lcc_backend_ids._update_search_data( + [self.comchain_backend_id] + ) ) if len(monujo_backends) > 1: raise ValueError("Safe partner has more than one wallet") @@ -277,8 +282,5 @@ def get_wallet_balance(self): "response": "", "error_message": "Failed to get wallet balance: %s" % e, } - - return { - "success": True, - "response": balance - } \ No newline at end of file + + return {"success": True, "response": balance}