mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
mypy: Amend logic in check_upload_within_quota to avoid None.
This commit is contained in:
committed by
Tim Abbott
parent
435bfb3159
commit
4efb83ee29
@@ -191,10 +191,11 @@ def currently_used_upload_space(realm: Realm) -> int:
|
||||
return used_space
|
||||
|
||||
def check_upload_within_quota(realm: Realm, uploaded_file_size: int) -> None:
|
||||
if realm.upload_quota_bytes() is None:
|
||||
upload_quota = realm.upload_quota_bytes()
|
||||
if upload_quota is None:
|
||||
return
|
||||
used_space = currently_used_upload_space(realm)
|
||||
if (used_space + uploaded_file_size) > realm.upload_quota_bytes():
|
||||
if (used_space + uploaded_file_size) > upload_quota:
|
||||
raise RealmUploadQuotaError(_("Upload would exceed your organization's upload quota."))
|
||||
|
||||
def get_file_info(request: HttpRequest, user_file: File) -> Tuple[Text, int, Optional[Text]]:
|
||||
|
||||
Reference in New Issue
Block a user