mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	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:
		@@ -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)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user