mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	typing: Add none-checks for stream.recipient_id.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							944e602788
						
					
				
				
					commit
					058dab5818
				
			@@ -789,6 +789,7 @@ def do_change_stream_permission(
 | 
			
		||||
        if old_invite_only_value != stream.invite_only:
 | 
			
		||||
            # Reset the Attachment.is_realm_public cache for all
 | 
			
		||||
            # messages in the stream whose permissions were changed.
 | 
			
		||||
            assert stream.recipient_id is not None
 | 
			
		||||
            Attachment.objects.filter(messages__recipient_id=stream.recipient_id).update(
 | 
			
		||||
                is_realm_public=None
 | 
			
		||||
            )
 | 
			
		||||
@@ -832,6 +833,7 @@ def do_change_stream_permission(
 | 
			
		||||
        if old_is_web_public_value != stream.is_web_public:
 | 
			
		||||
            # Reset the Attachment.is_realm_public cache for all
 | 
			
		||||
            # messages in the stream whose permissions were changed.
 | 
			
		||||
            assert stream.recipient_id is not None
 | 
			
		||||
            Attachment.objects.filter(messages__recipient_id=stream.recipient_id).update(
 | 
			
		||||
                is_web_public=None
 | 
			
		||||
            )
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user