Fix null round name#542#549
Conversation
|
I have implemented the null-check fix for rnd.name in download_results_csv and aligned it with the existing pattern used in download_round_entries_csv. For testing, I explored the database to identify rounds with existing entries and manually set rnd.name = NULL to simulate legacy/invalid data scenarios. I then verified the behavior through the UI by downloading CSVs for the affected rounds. Results:
This ensures the endpoint is safe against missing round names and consistent with similar fixes. |
|
Hey @Sanika123-art, thanks for the contribution! Great minds definitely think alike—this null-check is exactly what I implemented in #544. One small tip for contributing to Montage: I noticed a few "save changes" and "changes" commits in your history here. It's usually a good practice to squash those into a single descriptive commit (like your last one) before requesting a review. It keeps the project history much cleaner for the maintainers! Since #544 is already sitting in the queue and handles both export endpoints with a consistent pattern, we can probably let that one take precedence to avoid merge conflicts, but your independent validation of the |
|
|
||
| cookie_secret: ReplaceThisWithSomethingSomewhatSecret | ||
| superuser: Slaporte | ||
| superuser: Sanika06 |
There was a problem hiding this comment.
please dont edit this in the default, but make a local copy. If this isn't clearly documented, please give feedback, that would be welcome.
| dev_remote_cookie_value: "dev" | ||
|
|
||
| oauth_consumer_token: "15f09c9d766dba3d4a24a3c39616be4d" | ||
| oauth_secret_token: "03a93cb79fa0ffe5384bf96e167c0a6605a5a52f" |
There was a problem hiding this comment.
Please make sure not to leak secrets. You probably want to address this as a more fundamental step in your process.
|
Hey @Sanika123-art, I see you're running into some pushback on the config changes. Lodewijk is right about not editing The app's loader (
If the project actually needs a new config key (like |
Summary
This PR fixes a potential crash in CSV export endpoints caused by passing a null round name to
slugify.Problem
In
download_results_csv,rnd.namewas passed directly toslugify. Ifrnd.nameisNone(possible for legacy data created before validation), this results in anAttributeErrorand breaks CSV export.A similar pattern existed in
download_round_entries_csv.Solution
"unnamed-round"whenrnd.nameisNonedownload_results_csvdownload_round_entries_csvslugify(round_name, ...)Changes