fix: Fix list project
This commit is contained in:
parent
be62ed1b94
commit
1e1ee561d6
3 changed files with 3 additions and 3 deletions
|
@ -34,7 +34,7 @@ class IndexView(tables.DataTableView):
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
try:
|
try:
|
||||||
data = []
|
data = []
|
||||||
project_list, has_more = api.keystone.tenant_list(self.request)
|
project_list, has_more = api.keystone.tenant_list(self.request, user=self.request.user.id)
|
||||||
for d in self.balance_uc.list(self.request):
|
for d in self.balance_uc.list(self.request):
|
||||||
project = list(filter(lambda x: x.id == d['project']['tenant_id'], project_list))
|
project = list(filter(lambda x: x.id == d['project']['tenant_id'], project_list))
|
||||||
project_name = 'Unknown Project'
|
project_name = 'Unknown Project'
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<div class="row" style="margin-bottom: 15px;">
|
<div class="row" style="margin-bottom: 15px;">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
|
||||||
<b>Invoice Month</b>
|
<b>Project</b>
|
||||||
<select id="project_select" onchange="onProjectSelect(this.value)">
|
<select id="project_select" onchange="onProjectSelect(this.value)">
|
||||||
{% for i in project_list %}
|
{% for i in project_list %}
|
||||||
<option
|
<option
|
||||||
|
|
|
@ -46,7 +46,7 @@ class IndexView(tables.DataTableView):
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super().get_context_data(**kwargs)
|
context = super().get_context_data(**kwargs)
|
||||||
context['project_list'], _ = api.keystone.tenant_list(self.request)
|
context['project_list'], _ = api.keystone.tenant_list(self.request, user=self.request.user.id)
|
||||||
context['current_project_id'] = self.request.GET.get('project_id', self.request.user.project_id)
|
context['current_project_id'] = self.request.GET.get('project_id', self.request.user.project_id)
|
||||||
context['current_project_name'] = self.request.GET.get('project_name', self.request.user.project_id)
|
context['current_project_name'] = self.request.GET.get('project_name', self.request.user.project_id)
|
||||||
return context
|
return context
|
||||||
|
|
Loading…
Add table
Reference in a new issue