`DotPathValueMixin` raises a list-shaped validation error

Đang mở Phù hợp với người mới
#6,395 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Bắt đầu tại contentcuration/contentcuration/viewsets/common.py, ở DotPathValueMixin.get_value, rồi so sánh hành vi của nó với chiến lược xác thực theo từng trường trong issue #6387. Bổ sung kiểm thử hồi quy cho các đầu vào được liệt kê của /api/channel và /api/channelset; hoàn tất khi mỗi đầu vào trả về 400 và lỗi nằm dưới tên trường gây ra lỗi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

DEV: backend

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

DotPathValueMixin.get_value raises a DRF ValidationError with a list detail when a field's value isn't an object. It raises from get_value, outside the per-field error handling in Serializer.to_internal_value, so is_valid() fails to build the error dict and the REST request returns 500. Any logged-in user can trigger it on channel and channelset create.

Complexity: Low
Target branch: hotfixes

Context
The Change
  • A non-object value for a field using DotPathValueMixin should produce a normal field error on that field, following the strategy in #6387.
Acceptance Criteria
General
  • Every input in Context returns 400 with the error under the offending field's name.
Testing
  • Each input in Context has a regression test.

AI usage

I scoped the audit and chose the validation strategy in #6387. Claude Code found and reproduced these failures and drafted this issue.

Ngôn ngữ chính
Python
Star
212
Fork
321
Merge trung bình
1 ngày 7 giờ
Pull request đã merge (30 ngày)
14

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của learningequality/studio

Tất cả issue của learningequality/studio

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.