Merge pull request #153 from hongwei1/master

bugfix/fixed the bugs for sonarcloud
This commit is contained in:
Simon Redfern 2021-11-26 16:14:38 +01:00 committed by GitHub
commit 4d08501994
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 85 additions and 58 deletions

View File

@ -19,9 +19,9 @@
<h2>Endpoints</h2>
<div class="table-responsive">
<table class="table table-striped">
<table class="table table-striped" aria-describedby="api collection">
<thead>
<th>Operation Ids</th>
<th scope="col">Operation Ids</th>
</thead>
<tbody>
{% for api_collection_endpoint in api_collection_endpoints %}

View File

@ -206,7 +206,6 @@ table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSo
text-align: center;
line-height: 24px;
border-radius: 0;
border: 0;
padding: 9px 20px 11px;
border: 1px solid #333333;
}

View File

@ -155,13 +155,13 @@
</form>
<div class="table-responsive">
<table class="table table-hover tablesorter" id="branches-list">
<table class="table table-hover tablesorter" id="branches-list" aria-describedby="branches list">
<thead>
<th>Branch Id</th>
<th>Bank Id</th>
<th>Branch Name</th>
<th>More_info</th>
<th>Update Button</th>
<th scope="col">Branch Id</th>
<th scope="col">Bank Id</th>
<th scope="col">Branch Name</th>
<th scope="col">More_info</th>
<th scope="col">Update Button</th>
</thead>
<tbody>
{% for branch in branches_list %}

View File

@ -50,13 +50,13 @@
</ul>
<div class="table-responsive">
<table class="table table-hover tablesorter" id="consumer-list">
<table class="table table-hover tablesorter" id="consumer-list" aria-describedby="consumer list">
<thead>
<th>ID</th>
<th>Name</th>
<th>Description</th>
<th>Created</th>
<th>Action</th>
<th scope="col">ID</th>
<th scope="col">Name</th>
<th scope="col">Description</th>
<th scope="col">Created</th>
<th scope="col">Action</th>
</thead>
<tbody>

View File

@ -116,9 +116,9 @@ class DetailView(LoginRequiredMixin, FormView):
"""Put limits data to API"""
try:
data = ''
form = ApiConsumersForm(self.request.POST)
if form.is_valid():
data = form.cleaned_data
api_consumers_form = ApiConsumersForm(self.request.POST)
if api_consumers_form.is_valid():
data = api_consumers_form.cleaned_data
urlpath = '/management/consumers/{}/consumer/calls_limit'.format(data['consumer_id'])
@ -132,16 +132,16 @@ class DetailView(LoginRequiredMixin, FormView):
user = self.api.put(urlpath, payload=payload)
except APIError as err:
messages.error(self.request, err)
return super(DetailView, self).form_invalid(form)
return super(DetailView, self).form_invalid(api_consumers_form)
except Exception as err:
messages.error(self.request, "{}".format(err))
return super(DetailView, self).form_invalid(form)
return super(DetailView, self).form_invalid(api_consumers_form)
msg = 'calls limit of consumer {} has been updated successfully.'.format(
data['consumer_id'])
messages.success(self.request, msg)
self.success_url = self.request.path
return super(DetailView, self).form_valid(form)
return super(DetailView, self).form_valid(api_consumers_form)
def get_context_data(self, **kwargs):
context = super(DetailView, self).get_context_data(**kwargs)

View File

@ -22,14 +22,14 @@
</div>
<div class="table-responsive">
<table class="table table-hover tablesorter" id="entitementrequests-list">
<table class="table table-hover tablesorter" id="entitementrequests-list" aria-describedby="entitlement requests list">
<thead>
<th>Role Name</th>
<th>User name</th>
<th>Bank ID</th>
<th>Created</th>
<th>Action</th>
<th>Action</th>
<th scope="col">Role Name</th>
<th scope="col">User name</th>
<th scope="col">Bank ID</th>
<th scope="col">Created</th>
<th scope="col">Action</th>
<th scope="col">Action</th>
</thead>
<tbody>

View File

@ -135,15 +135,15 @@
{% block tab_content %}
<div class="tab-pane active">
<div class="table-responsive">
<table class="table table-hover tablesorter">
<table class="table table-hover tablesorter" aria-describedby="api list">
<thead>
<tr>
<th>#</th>
<th>Verb</th>
<th>URL</th>
<th>Date</th>
<th>Duration(ms)</th>
<th>Details</th>
<th scope="col">#</th>
<th scope="col">Verb</th>
<th scope="col">URL</th>
<th scope="col">Date</th>
<th scope="col">Duration(ms)</th>
<th scope="col">Details</th>
</tr>
</thead>
<tbody>

View File

@ -78,15 +78,15 @@
<div id="metrics-data">
<div class="table-responsive">
<table class="table table-hover tablesorter">
<table class="table table-hover tablesorter" aria-describedby="connector list">
<thead>
<tr>
<th>#</th>
<th>Date</th>
<th>Connector Name</th>
<th>Function Name</th>
<th>Correlation ID</th>
<th>Duration (ms)</th>
<th scope="col">#</th>
<th scope="col">Date</th>
<th scope="col">Connector Name</th>
<th scope="col">Function Name</th>
<th scope="col">Correlation ID</th>
<th scope="col">Duration (ms)</th>
</tr>
</thead>
<tbody>

View File

@ -76,6 +76,10 @@
<h2>Period : From {{ from_date }} to {{ to_date }}</h2>
<table border="1">
<tr>
<th></th>
<th></th>
</tr>
<tr>
<td>Total API calls:</td>
<td>{{ api_calls }}</td>

View File

@ -69,6 +69,10 @@
<h2>Period : From {{ from_date }} to {{ to_date }}</h2>
<table border="1">
<tr>
<th></th>
<th></th>
</tr>
<tr>
<td>Total API calls:</td>
<td>{{ api_calls }}</td>

View File

@ -68,6 +68,10 @@
<h2>Period : From {{ from_date }} to {{ to_date }}</h2>
<table border="1">
<tr>
<th></th>
<th></th>
</tr>
<tr>
<td>API calls:</td>
<td>{{ api_calls }}</td>

View File

@ -79,6 +79,10 @@
<h2>Period : From {{ from_date }} to {{ to_date }}</h2>
<table border="1">
<tr>
<th></th>
<th></th>
</tr>
<tr>
<td>Total API calls:</td>
<td>{{ api_calls }}</td>

View File

@ -68,6 +68,10 @@
<h2>Period : From {{ from_date }} to {{ to_date }}</h2>
<table border="1">
<tr>
<th></th>
<th></th>
</tr>
<tr>
<td>Total API calls:</td>
<td>{{ api_calls }}</td>

View File

@ -70,6 +70,10 @@
<h2>Period : From {{ from_date }} to {{ to_date }}</h2>
<table border="1">
<tr>
<th></th>
<th></th>
</tr>
<tr>
<td>Total API calls:</td>
<td>{{ api_calls }}</td>

View File

@ -70,6 +70,10 @@
<h2>Period : From {{ from_date }} to {{ to_date }}</h2>
<table border="1">
<tr>
<th></th>
<th></th>
</tr>
<tr>
<td>Total API calls:</td>
<td>{{ api_calls }}</td>

View File

@ -88,11 +88,11 @@
<h2>Entitlements</h2>
<div class="table-responsive">
<table class="table table-striped">
<table class="table table-striped" aria-describedby="uses table">
<thead>
<th>Role name</th>
<th>Bank Id</th>
<th>Action</th>
<th scope="col">Role name</th>
<th scope="col">Bank Id</th>
<th scope="col">Action</th>
</thead>
<tbody>
{% for entitlement in apiuser.entitlements.list %}

View File

@ -52,12 +52,12 @@
</ul>
<div class="table-responsive">
<table class="table table-hover tablesorter" id="users-list">
<table class="table table-hover tablesorter" id="users-list" aria-describedby="users list">
<thead>
<th>User Id</th>
<th>Username</th>
<th>Email</th>
<th>Action</th>
<th scope="col">User Id</th>
<th scope="col">Username</th>
<th scope="col">Email</th>
<th scope="col">Action</th>
</thead>
<tbody>
{% for user in users %}

View File

@ -65,14 +65,14 @@
<input type="submit" value="Create" class="btn btn-primary" />
<div class="table-responsive">
<table class="table table-hover tablesorter" id="invitation-list">
<table class="table table-hover tablesorter" id="invitation-list" aria-describedby="invitation list">
<thead>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th>company</th>
<th>country</th>
<th>status</th>
<th scope="col">First Name</th>
<th scope="col">Last Name</th>
<th scope="col">Email</th>
<th scope="col">company</th>
<th scope="col">country</th>
<th scope="col">status</th>
</thead>
<tbody>
{% for invitation in invitations %}