fix: enforce 30-record limit on all find queries and add trailing newlines to channel_message service
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user