fix(subscriptions): address code review feedback

- Use shared _require_admin from admin_users in subscriptions API endpoint
- Remove unnecessary Alpine.js hidden-div workaround in pricing.html
- Replace fragile string replace for OCR page count with proper Jinja {:,} format
- Improve comment wording in upload quota cleanup code
- Extract _scalar_count() helper in subscription.py to reduce repetition
- Add aria-valuemin='0' to all progressbar elements in subscription/index templates

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-06 16:10:00 +00:00
parent 179f6125e8
commit 7f521eb755
6 changed files with 24 additions and 46 deletions
+2 -1
View File
@@ -1303,7 +1303,8 @@ async def ui_upload(request: Request, db: DbSession, file: UploadFile = File(...
try:
check_upload_allowed(db, upload_owner_id, tier_id)
except QuotaExceeded as qe:
# Clean up the already-saved file before rejecting
# Clean up the temporarily written file before returning the error
# to avoid consuming disk space for a rejected upload.
if os.path.exists(target_path):
os.remove(target_path)
raise HTTPException(