Skip to content

Fix org unit validation on template download#391

Merged
Ramon-Jimenez merged 3 commits into
developmentfrom
fix/dataset-download-ou-validation
Jun 11, 2026
Merged

Fix org unit validation on template download#391
Ramon-Jimenez merged 3 commits into
developmentfrom
fix/dataset-download-ou-validation

Conversation

@xurxodev

Copy link
Copy Markdown

📌 References

📝 Implementation

  • Fix org unit validation on template download
  • Only require organisation unit selection when downloading populated tracker templates.
  • This prevents dataset template downloads from being blocked when org unit selection is configured for import-only, and defaults relationship OU filter to CAPTURE in that mode.

🔥 Notes for the reviewer

📹 Screenshots/Screen capture

Tested using MSF VPN

vpn_msf.mov

Tested using play 2.42

2.42-play.mov

📑 Others

- Only require organisation unit selection when downloading populated tracker templates.
- This prevents dataset template downloads from being blocked when org unit selection is configured for import-only, and defaults relationship OU filter to CAPTURE in that mode.
@bundlemon

bundlemon Bot commented Mar 18, 2026

Copy link
Copy Markdown

BundleMon

No change in files bundle size

Groups updated (1)
Status Path Size Limits
Build Folder
./**/*
1.72MB (+99B +0.01%) +20%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@Ramon-Jimenez Ramon-Jimenez left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xurxodev I think this is not entirely right.

While it is now possible to download the spreadsheet, the OrgUnit selector becomes empty. If I get it right, it should bring OU's configured for Capture privileges for the user downloading the template, but it is not doing so.

Could you please double check?

Thanks

…ection is set to import

When orgUnitSelection setting is "import", the org unit selector is hidden on the download page, so no org units are sent to the download use case. This left the org unit selector empty in the generated spreadsheet. Now it falls back to the intersection of the current user's capture org units and the org units of the selected dataset/program.
@xurxodev

Copy link
Copy Markdown
Author

@Ramon-Jimenez ready

@Ramon-Jimenez

Copy link
Copy Markdown

@xurxodev Working OK for OrgUnits that match exactly both Dataset and Capture privileges. But it seems it is not taking into account scenario where Dataset is configured for some 'children' OrgUnits and user has Capture privileges to 'parent' OrgUnit. In those cases, it is not pulling the OrgUnits, but it should.

…nloaded template when org unit selection is set to import
@xurxodev

Copy link
Copy Markdown
Author

@Ramon-Jimenez ready

@Ramon-Jimenez Ramon-Jimenez left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working great, thanks @xurxodev

@Ramon-Jimenez Ramon-Jimenez merged commit 7c747df into development Jun 11, 2026
6 checks passed
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.

2 participants