Skip to content

Commit

Permalink
[CLN] lcc_comchain_base: apply ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphan Sainléger committed Oct 17, 2024
1 parent b20433c commit 572d788
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lcc_comchain_base/models/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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": [],
Expand All @@ -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:
Expand All @@ -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")
Expand Down Expand Up @@ -277,8 +282,5 @@ def get_wallet_balance(self):
"response": "",
"error_message": "Failed to get wallet balance: %s" % e,
}

return {
"success": True,
"response": balance
}

return {"success": True, "response": balance}

0 comments on commit 572d788

Please sign in to comment.