From 08ba5ff74c1052e63cbd67f651b6801d33c547a1 Mon Sep 17 00:00:00 2001 From: Yiannis Christodoulou Date: Sun, 19 Oct 2025 12:42:39 +0300 Subject: [PATCH] Fix chapter validation in video_chapters view Update the check for 'chapters' in the request body to distinguish between missing and empty arrays, ensuring proper error handling when the 'chapters' key is absent. --- files/views/pages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/views/pages.py b/files/views/pages.py index b6f7df6a..d1b4aeff 100644 --- a/files/views/pages.py +++ b/files/views/pages.py @@ -258,7 +258,7 @@ def video_chapters(request, friendly_token): try: request_data = json.loads(request.body) data = request_data.get("chapters") - if not data: + if data is None: return JsonResponse({'success': False, 'error': 'Request must contain "chapters" array'}, status=400) chapters = []