v3 notification preferences: PUT with email_cadence but no notification_channel raises KeyError (500)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 66/100
Línea de trabajo
Empieza con el PUT a /api/notifications/v3/configurations/ usando el payload del issue, que debería reproducir el KeyError en _prepare_update_data. Compara ese método y _log_preference_update_event con _prepare_response_data, que ya infiere email_cadence como canal, y revisa UserNotificationPreferenceUpdateAllSerializer.validate(). Está terminado cuando la solicitud se completa infiriendo el canal, o devuelve un 400 que nombra el campo. Los mantenedores deben elegir qué comportamiento quieren antes de hacer el cambio.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
PUT /api/notifications/v3/configurations/ with an e-mail cadence and no notification_channel:
{"notification_app": "discussion", "notification_type": "grouped_notification",
"email_cadence": "Weekly"}
passes validation, then fails in the view:
KeyError: 'notification_channel'
in _prepare_update_data
Internal Server Error: /api/notifications/v3/configurations/
With "notification_channel": "email_cadence" added, the same update succeeds (200). The account MFE always sends the channel, so this is only reachable through the API.
Cause: UserNotificationPreferenceUpdateAllSerializer.validate() deliberately lets email_cadence stand in for the channel (it only requires notification_channel when there is no email_cadence), and NotificationPreferencesViewV3._prepare_response_data infers channel = 'email_cadence' in that case. But _prepare_update_data and _log_preference_update_event both read validated_data['notification_channel'] directly, so the request 500s before the update is applied.
Expected: infer email_cadence as the channel in _prepare_update_data and _log_preference_update_event, as _prepare_response_data already does (or, if the channel is meant to be mandatory, require it in the serializer so the client gets a 400 naming the field).
Environment: Tutor main, image of 2026-09-18; code unchanged on master as of 2026-10-13. Found by the Open edX end-to-end test suite.
- Lenguaje dominante
- Python
- Estrellas
- 8.2k
- Forks
- 4.4k
- Merge medio
- 2 d 10 h
- PR fusionados (30 d)
- 40
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openedx/openedx-platform
-
Discussion API: missing thread returns 500 (ForumV2RequestError not mapped to ThreadNotFoundError)Quizá libre de nuevo @mbhavu2007-lang la tomó hace 16 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
openedx/openedx-platform#39225 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
openedx/openedx-platform#39169 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
openedx/openedx-platform#39084 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Menos de una hora Aptitud para principiantes 82/100
openedx/openedx-platform#38792 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
openedx/openedx-platform#38544 ·
Los mantenedores suelen responder en 1 día
Todos los issues de openedx/openedx-platform
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
btclib-org/btclib-wallet#1045 ·
Los mantenedores suelen responder en 1 día
-
area-templates triage:bot-seen triage:needs-human
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
microsoft/aspire#22356 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
[Train] An elastic ScalingConfig(num_workers=(0, 0)) is accepted and the run waits foreverPosiblemente ocupada @wguo7 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
ray-project/ray#68217 ·
Los mantenedores suelen responder en 2 días