Serializers accept values the database or later code rejects
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 212
- Fork
- 321
- Merge medio
- 1g 7h
- PR unite (30g)
- 14
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di learningequality/studio
-
Community library status changes don't update `date_updated`Forse già presa @ArpitaSamanta10 l’ha presa oggi. Apertacommunity-contribution-in-progress DEV: backend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
learningequality/studio#6414 · 8 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
learningequality/studio#6410 ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
learningequality/studio#6409 ·
I maintainer di solito rispondono entro 1 giorno
-
DEV: backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
learningequality/studio#6407 ·
I maintainer di solito rispondono entro 1 giorno
-
Stripe webhook accepts events when no webhook secret is configuredForse già presa @adibmbrk l’ha presa oggi. Apertacommunity-contribution-in-progress DEV: backend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
learningequality/studio#6404 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di learningequality/studio
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
canonical/paas-charm#407 · 1 commento ·
I maintainer di solito rispondono entro 5 giorni
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
FAIRmat-NFDI/pynxtools-spm#136 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement tooling
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
`read_nexus` entry point points to a function that no longer existsForse già presa @RubelMozumder l’ha presa oggi. Apertaannotator bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
FAIRmat-NFDI/pynxtools#876 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: HTTP 499 (Client Closed Request) is classified as a non-retryable format_error, so a mid-flight abort fails the turn over instead of retryingForse già presa @yipinghuang1991 l’ha presa oggi. Apertacomp/agent P2 type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NousResearch/hermes-agent#156837 ·
I maintainer di solito rispondono entro 1 giorno