ticket and comment count and badge and new notif
This commit is contained in:
@@ -8,6 +8,9 @@ from django.utils.translation import gettext_lazy as _
|
||||
from django.views.generic import RedirectView, TemplateView
|
||||
from unfold.views import UnfoldModelAdminViewMixin
|
||||
from order.models import OrderModel
|
||||
from ticket.models import Ticket
|
||||
|
||||
|
||||
class HomeView(RedirectView):
|
||||
pattern_name = "admin:index"
|
||||
|
||||
@@ -16,8 +19,10 @@ class HomeView(RedirectView):
|
||||
|
||||
def dashboard_callback(request, context):
|
||||
pending_count = OrderModel.objects.filter(status='ADMIN_PENDING').count()
|
||||
open_tickets_count = Ticket.objects.filter(status__in=['open', 'in_progress']).count()
|
||||
context.update(random_data())
|
||||
context.update({'pending_count': pending_count})
|
||||
context.update({'open_tickets_count': open_tickets_count})
|
||||
return context
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user