Update attributes.
This commit is contained in:
		
							parent
							
								
									4266ac1f12
								
							
						
					
					
						commit
						eb1284060a
					
				| @ -69,10 +69,9 @@ class ChannelMessageService(BaseService): | |||||||
|                 "color": user["color"], |                 "color": user["color"], | ||||||
|             } |             } | ||||||
|         ) |         ) | ||||||
|         context['message'] = whitelist_attributes(context['message']) |  | ||||||
|         try: |         try: | ||||||
|             template = self.app.jinja2_env.get_template("message.html") |             template = self.app.jinja2_env.get_template("message.html") | ||||||
|             model["html"] = template.render(**context) |             model["html"] = whitelist_attributes(template.render(**context)) | ||||||
|         except Exception as ex: |         except Exception as ex: | ||||||
|             print(ex, flush=True) |             print(ex, flush=True) | ||||||
| 
 | 
 | ||||||
| @ -118,7 +117,6 @@ class ChannelMessageService(BaseService): | |||||||
|     async def save(self, model): |     async def save(self, model): | ||||||
|         context = {} |         context = {} | ||||||
|         context.update(model.record) |         context.update(model.record) | ||||||
|         context['message'] = whitelist_attributes(context['message']) |  | ||||||
|         user = await self.app.services.user.get(model["user_uid"]) |         user = await self.app.services.user.get(model["user_uid"]) | ||||||
|         context.update( |         context.update( | ||||||
|             { |             { | ||||||
| @ -129,7 +127,7 @@ class ChannelMessageService(BaseService): | |||||||
|             } |             } | ||||||
|         ) |         ) | ||||||
|         template = self.app.jinja2_env.get_template("message.html") |         template = self.app.jinja2_env.get_template("message.html") | ||||||
|         model["html"] = template.render(**context) |         model["html"] = whitelist_attributes(template.render(**context)) | ||||||
|         return await super().save(model) |         return await super().save(model) | ||||||
| 
 | 
 | ||||||
|     async def offset(self, channel_uid, page=0, timestamp=None, page_size=30): |     async def offset(self, channel_uid, page=0, timestamp=None, page_size=30): | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user