Serializers accept values the database or later code rejects
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 212
- Forks
- 321
- Ø Merge
- 1 T. 7 Std.
- Gemergte PRs (30 T.)
- 14
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus learningequality/studio
-
Community library status changes don't update `date_updated`Evtl. vergeben @ArpitaSamanta10 hat das heute übernommen. Offencommunity-contribution-in-progress DEV: backend good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
learningequality/studio#6414 · 8 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
DEV: backend
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
learningequality/studio#6410 ·
Maintainer antworten meist innerhalb von 1 Tag
-
DEV: backend
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
learningequality/studio#6409 ·
Maintainer antworten meist innerhalb von 1 Tag
-
DEV: backend
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
learningequality/studio#6407 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Stripe webhook accepts events when no webhook secret is configuredEvtl. vergeben @adibmbrk hat das heute übernommen. Offencommunity-contribution-in-progress DEV: backend good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
learningequality/studio#6404 · 3 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in learningequality/studio
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
canonical/paas-charm#407 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 5 Tagen
-
bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
FAIRmat-NFDI/pynxtools-spm#136 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement tooling
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
Maintainer antworten meist innerhalb von 1 Tag
-
`read_nexus` entry point points to a function that no longer existsEvtl. vergeben @RubelMozumder hat das heute übernommen. Offenannotator bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
FAIRmat-NFDI/pynxtools#876 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
[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 retryingEvtl. vergeben @yipinghuang1991 hat das heute übernommen. Offencomp/agent P2 type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
NousResearch/hermes-agent#156837 ·
Maintainer antworten meist innerhalb von 1 Tag