Added 30 limit on all tables.
This commit is contained in:
		
							parent
							
								
									8e825a90c6
								
							
						
					
					
						commit
						01d8093e72
					
				
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -4,6 +4,8 @@
 | 
			
		||||
.backup*
 | 
			
		||||
docs
 | 
			
		||||
snek.d*
 | 
			
		||||
.rcontext.txt 
 | 
			
		||||
*.zip
 | 
			
		||||
*.db*
 | 
			
		||||
*.png
 | 
			
		||||
# ---> Python
 | 
			
		||||
 | 
			
		||||
@ -12,3 +12,5 @@ class ChannelMessageService(BaseService):
 | 
			
		||||
        if await self.save(model):
 | 
			
		||||
            return model
 | 
			
		||||
        raise Exception(f"Failed to create channel message: {model.errors}.")
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
@ -58,6 +58,8 @@ class BaseService:
 | 
			
		||||
        raise Exception(f"Couldn't save model. Errors: f{errors}")
 | 
			
		||||
 | 
			
		||||
    async def find(self, **kwargs):
 | 
			
		||||
        if not "_limit" in kwargs or int(kwargs.get("_limit")) > 30:
 | 
			
		||||
            kwargs["_limit"] = 30
 | 
			
		||||
        async for model in self.mapper.find(**kwargs):
 | 
			
		||||
            yield model
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user