mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 12:03:46 +00:00 
			
		
		
		
	delete_in_topic: Don't unnecessarily fetch .recipient.
This reverts commitf119c33789. With51cef01c29merged, there is no need to fetch .recipient here, as it won't be accessed by the delete messages codepath.
This commit is contained in:
		
				
					committed by
					
						 Tim Abbott
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							cacc89e4d0
						
					
				
				
					commit
					5ef6852cfe
				
			| @@ -1323,10 +1323,8 @@ def delete_in_topic( | ||||
|         if time.monotonic() >= start_time + 50: | ||||
|             return json_success(request, data={"complete": False}) | ||||
|         with transaction.atomic(durable=True): | ||||
|             messages_to_delete = ( | ||||
|                 messages.select_related("recipient") | ||||
|                 .order_by("-id")[0:batch_size] | ||||
|                 .select_for_update(of=("self",)) | ||||
|             messages_to_delete = messages.order_by("-id")[0:batch_size].select_for_update( | ||||
|                 of=("self",) | ||||
|             ) | ||||
|             if not messages_to_delete: | ||||
|                 break | ||||
|   | ||||
		Reference in New Issue
	
	Block a user