Resolve merge conflict in authStore.ts - use dynamic import for fetchAPI

This commit is contained in:
IGNY8 VPS (Salman)
2025-11-16 13:47:10 +00:00
24 changed files with 2374 additions and 5411 deletions

View File

@@ -663,17 +663,47 @@ class ImagesViewSet(SiteSectorModelViewSet):
account = getattr(request, 'account', None)
# Get site_id and sector_id from query parameters
site_id = request.query_params.get('site_id')
sector_id = request.query_params.get('sector_id')
# Get all content that has images (either directly or via task)
# First, get content with direct image links
queryset = Content.objects.filter(images__isnull=False)
if account:
queryset = queryset.filter(account=account)
# Apply site/sector filtering if provided
if site_id:
try:
queryset = queryset.filter(site_id=int(site_id))
except (ValueError, TypeError):
pass
if sector_id:
try:
queryset = queryset.filter(sector_id=int(sector_id))
except (ValueError, TypeError):
pass
# Also get content from images linked via task
task_linked_images = Images.objects.filter(task__isnull=False, content__isnull=True)
if account:
task_linked_images = task_linked_images.filter(account=account)
# Apply site/sector filtering to task-linked images
if site_id:
try:
task_linked_images = task_linked_images.filter(site_id=int(site_id))
except (ValueError, TypeError):
pass
if sector_id:
try:
task_linked_images = task_linked_images.filter(sector_id=int(sector_id))
except (ValueError, TypeError):
pass
# Get content IDs from task-linked images
task_content_ids = set()
for image in task_linked_images:
@@ -694,6 +724,7 @@ class ImagesViewSet(SiteSectorModelViewSet):
for content_id in content_ids:
try:
content = Content.objects.get(id=content_id)
# Get images linked directly to content OR via task
content_images = Images.objects.filter(
Q(content=content) | Q(task=content.task)