logging attckers try and add location to admin

This commit is contained in:
Parsa Nazer
2025-02-21 01:08:46 +03:30
parent 7679e82fd3
commit c7524e9e63
12 changed files with 395 additions and 16 deletions
+3
View File
@@ -2,6 +2,7 @@ from order.models import OrderModel
from product.models import DollorModel, CommentModel
from ticket.models import Ticket
from home.models import LearnVideoModel
from account.models import SecurityBreachAttemptModel
def admin_pending_count(request):
pending_count = OrderModel.objects.filter(status='ADMIN_PENDING').count()
@@ -20,6 +21,8 @@ def new_ticket_count(request):
def new_learn_video_count(request):
return LearnVideoModel.objects.filter(viewd=False).count()
def new_attck_count(request):
return SecurityBreachAttemptModel.objects.filter(viewd=False).count()
from django.contrib import admin, messages
from unfold.admin import ModelAdmin