mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 20:13:46 +00:00 
			
		
		
		
	context_processors: Cache the realm description in default context.
This commit is contained in:
		
				
					committed by
					
						 Tim Abbott
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							6e8e7feffc
						
					
				
				
					commit
					261166f96d
				
			
							
								
								
									
										9
									
								
								zerver/lib/realm_description.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								zerver/lib/realm_description.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,9 @@ | ||||
| from zerver.models import Realm | ||||
| from zerver.lib.cache import cache_with_key, realm_rendered_description_cache_key | ||||
| from zerver.lib.bugdown import convert as bugdown_convert | ||||
|  | ||||
| @cache_with_key(realm_rendered_description_cache_key, timeout=3600*24*7) | ||||
| def get_realm_rendered_description(realm: Realm) -> str: | ||||
|     realm_description_raw = realm.description or "The coolest place in the universe." | ||||
|     return bugdown_convert(realm_description_raw, message_realm=realm, | ||||
|                            no_previews=True) | ||||
		Reference in New Issue
	
	Block a user