mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-05 23:18:53 -05:00
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.
This commit is contained in:
parent
03872d0b25
commit
08ba5ff74c
@ -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 = []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user