Skip to content

fix: celery-worker now receives context from http request for csv reports#43

Open
efortish wants to merge 1 commit into
nau/teak.masterfrom
ks/csv-report-fix
Open

fix: celery-worker now receives context from http request for csv reports#43
efortish wants to merge 1 commit into
nau/teak.masterfrom
ks/csv-report-fix

Conversation

@efortish
Copy link
Copy Markdown
Contributor

Related issue: https://github.com/fccn/nau-technical/issues/862


enrolled_students_features() was recomputing the list of student fields by calling get_student_features_with_custom() inside the Celery task, which relies on get_current_request() to resolve the site configuration. Since Celery workers have no HTTP request context, configuration_helpers.get_value() always returned the default empty list, causing custom attributes (e.g. nau_nif) to be absent from the student dict while still present in the CSV header — resulting in misaligned columns. The fix uses the features parameter directly (already computed correctly during the HTTP request and serialized into the task input) instead of re-querying site config in the wrong context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant