Some improvement in code

This commit is contained in:
Reena Aheer 2023-04-20 12:28:21 +02:00
parent dbdbcfa1de
commit 42d8b1e336
5 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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')

View File

@ -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)

View File

@ -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 %}

View File

@ -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"""