Allow admin to list invoices
This commit is contained in:
parent
8c04acaff8
commit
6a7b5459ce
1 changed files with 9 additions and 3 deletions
|
@ -1169,9 +1169,15 @@ class InvoiceListView(LoginRequiredMixin, ListView):
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super(InvoiceListView, self).get_context_data(**kwargs)
|
context = super(InvoiceListView, self).get_context_data(**kwargs)
|
||||||
mabs = MonthlyHostingBill.objects.filter(
|
if ('user_email' in self.request.GET
|
||||||
customer__user=self.request.user
|
and self.request.user.email == settings.ADMIN_EMAIL):
|
||||||
)
|
mabs = MonthlyHostingBill.objects.filter(
|
||||||
|
customer__user=self.request.GET['user_email']
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
mabs = MonthlyHostingBill.objects.filter(
|
||||||
|
customer__user=self.request.user
|
||||||
|
)
|
||||||
ips_dict = {}
|
ips_dict = {}
|
||||||
for mab in mabs:
|
for mab in mabs:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue