Фикс.

This commit is contained in:
zakhy 2025-04-16 16:02:29 +07:00
parent bdde2b8f7d
commit 81e04195ba
2 changed files with 4 additions and 2 deletions

View File

@ -177,7 +177,7 @@
// Функция для обновления маркеров
async function updateMarkers() {
// Обновление работников
const workersData = await fetch('/wklocation/update_object/')
const workersData = await fetch('/wklocation/update_object/?all=true')
.then(r => r.json());
const workersDataActive = workersData.filter(el => el.active)

View File

@ -69,8 +69,10 @@ def update_object(request, pk=None):
date_start = datetime.now() - timedelta(days=1)
if pk:
workers = WorkersLocation.objects.filter(id=pk)
else:
elif request.GET.get("all") == "true":
workers = WorkersLocation.objects.all()
else:
workers = WorkersLocation.objects.filter(active=True)
workers_mas = []
for worker in workers:
worker_name = worker.name if worker.name else worker.uid