Allow admin to list invoices
This commit is contained in:
parent
8c04acaff8
commit
6a7b5459ce
1 changed files with 9 additions and 3 deletions
|
@ -1169,6 +1169,12 @@ 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)
|
||||||
|
if ('user_email' in self.request.GET
|
||||||
|
and self.request.user.email == settings.ADMIN_EMAIL):
|
||||||
|
mabs = MonthlyHostingBill.objects.filter(
|
||||||
|
customer__user=self.request.GET['user_email']
|
||||||
|
)
|
||||||
|
else:
|
||||||
mabs = MonthlyHostingBill.objects.filter(
|
mabs = MonthlyHostingBill.objects.filter(
|
||||||
customer__user=self.request.user
|
customer__user=self.request.user
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue