Serializers accept values the database or later code rejects
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with the four serializers linked in the issue: the admin user, community library submission, and channel serializers, then read the validation strategy in #6387. Add regression tests for each listed input and check that invalid requests return 400 without saving; verify that null resolution_reason behaves like an omitted field and that approving object-shaped categories exports the channel and marks the submission live.
Written by the indexing model from the issue text.
Description
Overview
Some serializers accept values that the database, or the code that runs after validation, then rejects. The request passes validation and fails on save, returning 500, or saves data that breaks later.
Complexity: Medium
Target branch: hotfixes
Context
All inputs below were reproduced:
- The admin user serializer's
disk_spaceis a DRFFloatField, which accepts infinity.PATCH /api/admin-users/<id>with{"disk_space": "1e400"}raisesValueError: Out of range float values are not JSON compliant. - The community library
resolveserializer calls.strip()onresolution_reasonandfeedback_notes, which acceptnull. Rejecting with either set tonullraisesAttributeError. ChannelSerializertakesidfrom the model's 32-characterCharField.POST /api/channelwith{"id": "abc", "name": "x"}returns 201 and creates a channel that thechannels/<32 characters>/routes can't open. Related: #5783.- Community library submission
categoriesaccepts any JSON. A list passes validation, and approving the submission then raisesAttributeErroroncategories.items().resolvereturns 200 with statusAPPROVED, but the channel never goes live.
The Change
- Each serializer in Context should enforce the database's limits and the types the code after it expects, following the strategy in #6387.
- A channel
idshould be a 32-character hex UUID. categoriesshould be an object mapping category ids to booleans, as the frontend sends it. The test fixtures that use a list should change to match.
Acceptance Criteria
General
- Every input in Context returns 400 and saves nothing.
- Rejecting a submission with
resolution_reason: nullgets the same response as omittingresolution_reason. - Approving a submission whose
categoriesis an object exports the channel and marks the submission live.
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.
- Dominant language
- JavaScript
- Stars
- 214
- Forks
- 327
- Avg merge
- 17h 5m
- Merged PRs (30d)
- 25
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from learningequality/studio
-
Community library status changes don't update `date_updated`Possibly taken @ArpitaSamanta10 claimed this 14 days ago. Opencommunity-contribution-in-progress DEV: backend good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
learningequality/studio#6414 · 8 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Activation key can activate a different account whose email differs only in casePossibly taken @Madhu-priya123 claimed this 5 days ago. OpenDEV: backend
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
learningequality/studio#6410 · 2 comments ·
Maintainers usually reply within 1 day
-
DEV: backend
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
learningequality/studio#6409 ·
Maintainers usually reply within 1 day
-
DEV: backend
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
learningequality/studio#6407 ·
Maintainers usually reply within 1 day
-
Stripe webhook accepts events when no webhook secret is configuredPossibly taken @adibmbrk claimed this 14 days ago. Opencommunity-contribution-in-progress DEV: backend good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
learningequality/studio#6404 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
All issues in learningequality/studio
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
babalae/bettergi-scripts-list#3905 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] "Configure Colota" opens Colota with "Invalid configuration: No configuration data in URL"Open
Difficulty 1/5 1-3 hours Newbie friendliness 87/100
dedicatedcode/reitti#1445 ·
Maintainers usually reply within 1 day
-
New tool: Uncle DeskPossibly taken @github-actions claimed this today. Opensubmission triage
Difficulty 1/5 Under an hour Newbie friendliness 85/100
kausalflow/tools#384 · 1 comment ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
area: css
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day