mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 16:34:46 +00:00
Codacy corrections + sql queries
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
import json
|
||||
import requests
|
||||
from plaid import Client
|
||||
from plaid.errors import APIError, ItemError
|
||||
@@ -34,7 +33,7 @@ class PlaidConnector():
|
||||
def get_access_token(self, public_token):
|
||||
if public_token is None:
|
||||
frappe.log_error(_("Public token is missing for this bank"), _("Plaid public token error"))
|
||||
|
||||
|
||||
response = self.client.Item.public_token.exchange(public_token)
|
||||
access_token = response['access_token']
|
||||
|
||||
@@ -68,10 +67,10 @@ class PlaidConnector():
|
||||
account_ids = [account_id]
|
||||
|
||||
response = self.client.Transactions.get(self.access_token, start_date=start_date, end_date=end_date, account_ids=account_ids)
|
||||
|
||||
|
||||
else:
|
||||
response = self.client.Transactions.get(self.access_token, start_date=start_date, end_date=end_date)
|
||||
|
||||
|
||||
transactions = response['transactions']
|
||||
|
||||
while len(transactions) < response['total_transactions']:
|
||||
|
||||
@@ -2,11 +2,7 @@
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Plaid Settings', {
|
||||
refresh: function(frm) {
|
||||
|
||||
},
|
||||
|
||||
connect_btn: function(frm) {
|
||||
connect_btn: function() {
|
||||
frappe.set_route('bank-reconciliation');
|
||||
}
|
||||
});
|
||||
@@ -83,7 +83,7 @@ def add_bank_accounts(response, bank, company):
|
||||
|
||||
result.append(new_account.name)
|
||||
|
||||
except frappe.UniqueValidationError as e:
|
||||
except frappe.UniqueValidationError:
|
||||
frappe.msgprint(_("Bank account {0} already exists and could not be created again").format(new_account.account_name))
|
||||
except Exception:
|
||||
frappe.throw(frappe.get_traceback())
|
||||
@@ -99,7 +99,7 @@ def add_account_type(account_type):
|
||||
"doctype": "Account Type",
|
||||
"account_type": account_type
|
||||
}).insert()
|
||||
except:
|
||||
except Exception:
|
||||
frappe.throw(frappe.get_traceback())
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
class TestPlaidSettings(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user