mirror of
https://github.com/OpenBankProject/API-Manager.git
synced 2026-02-06 17:06:45 +00:00
Some improvement in code
This commit is contained in:
parent
dbdbcfa1de
commit
42d8b1e336
@ -155,7 +155,7 @@ def apicollections_update(request):
|
||||
'is_sharable': True if request.POST.get('api_collection_is_sharable').strip().lower() == "true" else False,
|
||||
'description': request.POST.get('api_collection_description').strip()
|
||||
}
|
||||
result = api.put(urlpath, payload=payload)
|
||||
result = api.put(urlpath, payload=payload, version=settings.API_ROOT['v510'])
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@ -324,7 +324,7 @@ API_ROOT = {
|
||||
"v510": OBPv510
|
||||
}
|
||||
# For some reason, swagger is not available at the latest API version
|
||||
API_URL_SWAGGER = API_HOST + '/obp/v1.4.0/resource-docs/v' + OBPv500 + '/swagger' # noqa
|
||||
#API_URL_SWAGGER = API_HOST + '/obp/v1.4.0/resource-docs/v' + OBPv500 + '/swagger' # noqa
|
||||
|
||||
if not OAUTH_CONSUMER_KEY:
|
||||
raise ImproperlyConfigured('Missing settings for OAUTH_CONSUMER_KEY')
|
||||
|
||||
@ -168,7 +168,7 @@ class IndexBranchesView(LoginRequiredMixin, FormView):
|
||||
error_once_only(self.request, err)
|
||||
return super(IndexBranchesView, self).form_invalid(form)
|
||||
if 'code' in result and result['code']>=400:
|
||||
error_once_only(self.request, result['message'])
|
||||
messages.error(self.request, result['message'])
|
||||
return super(IndexBranchesView, self).form_valid(form)
|
||||
msg = 'Branch {} for Bank {} has been created successfully!'.format(result['id'], result['bank_id'])
|
||||
messages.success(self.request, msg)
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
{% if forloop.counter0 > 0 %}
|
||||
<div class="col-sm-12 col-sm-2">
|
||||
<div class="form-group">
|
||||
<button class="btn btn-primary btn-red forUpdate">{% trans "Update" %}</button>
|
||||
<button class="btn btn-primary forUpdate">{% trans "Update" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@ -142,8 +142,8 @@ class API(object):
|
||||
else:
|
||||
return None
|
||||
|
||||
def get_swagger(self):
|
||||
"""Gets the swagger definition from the API"""
|
||||
""" def get_swagger(self):
|
||||
""""""Gets the swagger definition from the API """"""
|
||||
# Poor man's caching ...
|
||||
if not self.session_data.get('swagger'):
|
||||
# API throws 500 if authenticated via GatewayLogin ...
|
||||
@ -151,7 +151,7 @@ class API(object):
|
||||
response = requests.get(settings.API_URL_SWAGGER)
|
||||
swagger = self.handle_response(response)
|
||||
self.session_data['swagger'] = swagger
|
||||
return self.session_data.get('swagger')
|
||||
return self.session_data.get('swagger') """
|
||||
|
||||
def get_bank_id_choices(self):
|
||||
"""Gets a list of bank ids and bank ids as used by form choices"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user