upload: Remove old per-user quota feature.

We'll replace this primarily with per-realm quotas (plus the simple
per-file limit of settings.MAX_FILE_UPLOAD_SIZE, 25 MiB by default).

We do want per-user quotas too, but they'll need some more management
apparatus around them so an admin has a practical way to set them
differently for different users.  And the error handling in this
existing code is rather confused.  Just clear this feature out
entirely for now; then we'll build the per-realm version more cleanly,
and then we can later add back per-realm quotas modelled after that.

The migration to actually remove the field is in a subsequent commit.

Based in part on work by Vishnu Ks (hackerkid).
This commit is contained in:
Greg Price
2018-01-26 18:30:26 -08:00
committed by Greg Price
parent 0fcf0c5052
commit 55cf54c087
11 changed files with 10 additions and 97 deletions

View File

@@ -36,7 +36,6 @@ from zerver.lib.actions import (
get_status_dict, streams_to_dicts_sorted,
default_stream_groups_to_dicts_sorted
)
from zerver.lib.upload import get_total_uploads_size_for_user
from zerver.lib.user_groups import user_groups_in_realm_serialized
from zerver.tornado.event_queue import request_event_queue, get_user_events
from zerver.models import Client, Message, Realm, UserPresence, UserProfile, \
@@ -116,12 +115,6 @@ def fetch_initial_state_data(user_profile: UserProfile,
if want('attachments'):
state['attachments'] = user_attachments(user_profile)
if want('upload_quota'):
state['upload_quota'] = user_profile.quota
if want('total_uploads_size'):
state['total_uploads_size'] = get_total_uploads_size_for_user(user_profile)
if want('hotspots'):
state['hotspots'] = get_next_hotspots(user_profile)