Errors unless `FORUM_MONGODB_DATABASE` and `FORUM_MONGODB_CLIENT_PARAMETERS` are defined

Aperta
#137 9 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
mongodb, python
Ambito
backend, databases

Direzione di ricerca

Inizia in forum/backends/mongodb/api.py, in get_course_id_by_thread_id, poi segui forum/api/threads.py, in get_course_id_by_thread, e il percorso corrispondente per i commenti. Verifica come vengono gestiti FORUM_MONGODB_DATABASE e FORUM_MONGODB_CLIENT_PARAMETERS quando mancano, individua eventuali altri punti di inferenza di course_id e verifica che una configurazione assente restituisca None, così che CourseWaffleFlag utilizzi il valore predefinito a livello di sito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

By default, we had intended for sites running master to require no changes at all to their configuration to keep the old experience. We currently break this, as @regisb notes in this post. The code is currently doing this because we sometimes need to derive the course_id to know which code path to take, and that's not always available from the request itself.

Is it feasible to add checking to forum.backends.mongodb.api.get_course_id_by_thread_id to explicitly check to see if FORUM_MONGODB_DATABASE and FORUM_MONGODB_CLIENT_PARAMETERS exist, and return None if they don't? That should make the public api call get_course_id_by_thread return None. (And the same for get_course_id_by_comment.) When passing a course_id of None to the CourseWaffleFlag check, it should return the default value for the site as a whole. Which I think will do what we want in a backwards compatible way?

Would that work? Are there other places where we need to try to infer the course_id?

Lingua principale
Python
Stelle
5
Fork
28
Merge medio
12m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openedx/forum

Tutte le issue di openedx/forum

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.