mirror of
https://github.com/OpenBankProject/API-Manager.git
synced 2026-02-06 13:36:48 +00:00
hard coded API_VERSION
This commit is contained in:
parent
155bafcc2f
commit
822f3e6b5c
@ -27,7 +27,7 @@ class AccountListView(IndexAccountsView, LoginRequiredMixin, FormView ):
|
||||
#self.bankids = self.get_banks()
|
||||
accounts_list = []
|
||||
#for bank_id in self.bankids:
|
||||
urlpath = '/my/accounts'
|
||||
urlpath = 'v5.1.0/my/accounts'
|
||||
result = api.get(urlpath)
|
||||
if 'accounts' in result:
|
||||
accounts_list.extend(result['accounts'])
|
||||
@ -55,7 +55,7 @@ class ExportCsvView(LoginRequiredMixin, View):
|
||||
self.bankids = get_banks(self.request)
|
||||
accounts_list = []
|
||||
for bank_id in self.bankids:
|
||||
urlpath = 'banks/{}/accounts'.format(bank_id)
|
||||
urlpath = 'v5.1.0/banks/{}/accounts'.format(bank_id)
|
||||
result = api.get(urlpath)
|
||||
if 'accounts' in result:
|
||||
accounts_list.extend(result['accounts'])
|
||||
|
||||
@ -44,7 +44,7 @@ class IndexBanksView(LoginRequiredMixin, FormView):
|
||||
def form_valid(self, form):
|
||||
try:
|
||||
data = form.cleaned_data
|
||||
urlpath = '/banks'
|
||||
urlpath = 'v5.1.0/banks'
|
||||
payload ={
|
||||
"id": data["bank_id"],
|
||||
"bank_code": data["bank_code"],
|
||||
|
||||
@ -9,7 +9,7 @@ from django.contrib import messages
|
||||
from obp.api import API, APIError, LOGGER
|
||||
from django.core.cache import cache
|
||||
|
||||
USER_CURRENT = "/users/current"
|
||||
USER_CURRENT = "v5.1.0/users/current"
|
||||
|
||||
def api_root(request):
|
||||
"""Returns the configured API_ROOT"""
|
||||
|
||||
@ -156,7 +156,7 @@ class API(object):
|
||||
def get_bank_id_choices(self):
|
||||
"""Gets a list of bank ids and bank ids as used by form choices"""
|
||||
choices = [('', _('Choose ...'))]
|
||||
result = self.get('/banks')
|
||||
result = self.get('v5.1.0/banks')
|
||||
for bank in sorted(result['banks'], key=lambda d: d['id']) :
|
||||
choices.append((bank['id'], bank['id']))
|
||||
return choices
|
||||
|
||||
@ -29,7 +29,7 @@ class LoginToDjangoMixin(object):
|
||||
# Here, we already get the Token for the api call.
|
||||
api = API(self.request.session.get('obp'))
|
||||
try:
|
||||
data = api.get('/users/current')
|
||||
data = api.get('v5.1.0/users/current')
|
||||
except APIError as err:
|
||||
messages.error(self.request, err)
|
||||
except Exception as err:
|
||||
|
||||
@ -23,7 +23,7 @@ class SystemView(LoginRequiredMixin, FormView):
|
||||
api = API(self.request.session.get('obp'))
|
||||
try:
|
||||
system_view = []
|
||||
urlpath = '/system-views/owner'
|
||||
urlpath = 'v5.1.0/system-views/owner'
|
||||
result = api.get(urlpath)
|
||||
system_view = result
|
||||
except APIError as err:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user