mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-30 19:43:47 +00:00 
			
		
		
		
	digest: Don't send emails to deactivated users, even if queued.
This commit is contained in:
		
				
					committed by
					
						 Tim Abbott
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							7a13836d26
						
					
				
				
					commit
					fcf82bf047
				
			| @@ -348,7 +348,11 @@ def get_digest_context(user: UserProfile, cutoff: float) -> Dict[str, Any]: | ||||
| def bulk_handle_digest_email(user_ids: List[int], cutoff: float) -> None: | ||||
|     # We go directly to the database to get user objects, | ||||
|     # since inactive users are likely to not be in the cache. | ||||
|     users = UserProfile.objects.filter(id__in=user_ids).order_by("id").select_related("realm") | ||||
|     users = ( | ||||
|         UserProfile.objects.filter(id__in=user_ids, is_active=True, realm__deactivated=False) | ||||
|         .order_by("id") | ||||
|         .select_related("realm") | ||||
|     ) | ||||
|     context_map = bulk_get_digest_context(users, cutoff) | ||||
|  | ||||
|     digest_users = [] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user