Skip to content

Feat/organization quota limits#560

Open
whlongg wants to merge 1 commit intoVNOI-Admin:masterfrom
whlongg:feat/organization-quota-limits
Open

Feat/organization quota limits#560
whlongg wants to merge 1 commit intoVNOI-Admin:masterfrom
whlongg:feat/organization-quota-limits

Conversation

@whlongg
Copy link
Contributor

@whlongg whlongg commented Mar 8, 2026

Description
Add per-organization quota limits for problem count and test data storage. Enforce limits in views and display in the UI.

Type of change: new feature

Organizations currently have no resource limits, which can lead to unbounded storage and problem creation. This feature enables administrators to set reasonable quotas per organization.

Fixes #559

image

By submitting this pull request, I confirm that my contribution is made under the terms of the AGPL-3.0 License.

Enforces quota limits for organizations when creating problems and uploading test data.
- Added `max_problems` and `max_storage` to Organization (with fallbacks to settings).
- Refactored storage calculation to measure total file sizes across all test data fields.
- Re-implemented the `backfill_problem_data_size` management command to be substantially faster for large datasets by utilizing `os.path.getsize` and `bulk_update`.
- All users, including superusers, are now subject to the organization quota.
@whlongg whlongg force-pushed the feat/organization-quota-limits branch from 8c951e6 to cc0dbb8 Compare March 8, 2026 07:01
@magnified103 magnified103 self-requested a review March 8, 2026 09:11
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.

Add organization-level quota limits

1 participant