Skip to content

[GRDM-57860] Add default max quota configuration for institutions not using NII Storage#751

Draft
ndnhat1 wants to merge 7 commits into
developfrom
feature/nii_grdm_202603_step9/2.3_initial_quota_setting
Draft

[GRDM-57860] Add default max quota configuration for institutions not using NII Storage#751
ndnhat1 wants to merge 7 commits into
developfrom
feature/nii_grdm_202603_step9/2.3_initial_quota_setting

Conversation

@ndnhat1

@ndnhat1 ndnhat1 commented Jun 16, 2026

Copy link
Copy Markdown

Purpose

The purpose of these changes is to allow institution administrators to configure a default max quota that will be applied to all users affiliated with their institution. This feature applies to institutions using Institutional Storage (not NII Storage).
If no default max quota is configured, the system falls back to the global DEFAULT_MAX_QUOTA setting.

Changes

  • Create InstitutionDefaultMaxQuota model - New model to store default max quota configuration per institution
  • Implement get_default_max_quota function - New utility function that retrieves the default max quota for a user based on their affiliated institution and storage type
  • Update quota recalculation logic - Modify quota_recalc views to use get_default_max_quota for CUSTOM_STORAGE type
  • Update institutional storage quota control views - Add functionality to retrieve and apply default max quota configuration for institution
  • Add database migration - Create migration 0267 for InstitutionDefaultMaxQuota model

QA Notes

Documentation

Side Effects

Ticket

57860

+ Fix institution default max quota issues (owner lookup, zero quota, quota retrieval, transaction handling)
+ Refactor quota handling logic
+ Update migration (use OneToOneField and remove db_index)
+ Update default value in "Institutional Storage Quota Control" screen
+ Fix user quota update rollback behavior
+ Align related_name between model and migration
+ Remove unused user parameter from file_modified
+ Update UT after change logic

@yacchin1205 yacchin1205 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.

以下の点は、少し注意が必要なように思いましたが、Approveとさせていただきます。ご参考まで。

  • InstitutionDefaultMaxQuota を活用するためには、InstitutionDefaultMaxQuotaだけを更新するUIの動線があると良いように思いました。今は、InstitutionDefaultMaxQuotaと、全ユーザーのQuota変更を一律に行うように見えるので、ユーザーに対する個別Quota変更対応があった場合、この操作は不可能になる。(特別対応をしたユーザーの分のQuotaも戻ってしまうため) とすると、この操作はかなり破壊的な操作であって、機関管理者が選択しづらいように思いました。
  • エラー処理のうち、 IntegrityErrorの処理においては、warningログ等を記録しておくと運用の助けになるのではないかと感じました。IntegrityErrorは、すでに同一レコードがある場合以外でも、今後発生する可能性があると思うので、ここで例外を記録しておくと、except内の処理も失敗した場合の調査の助けになるように感じました。

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.

3 participants