mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	Restore the default django.utils.log.AdminEmailHandler when ERROR_REPORTING is enabled. Those with more sophisticated needs can turn it off and use Sentry or a Sentry-compatible system. Signed-off-by: Anders Kaseorg <anders@zulip.com>
		
			
				
	
	
		
			17 lines
		
	
	
		
			579 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			579 B
		
	
	
	
		
			Python
		
	
	
	
	
	
# System documented in https://zulip.readthedocs.io/en/latest/subsystems/logging.html
 | 
						|
import os
 | 
						|
import subprocess
 | 
						|
from typing import Optional
 | 
						|
 | 
						|
 | 
						|
def try_git_describe() -> Optional[str]:
 | 
						|
    try:  # nocoverage
 | 
						|
        return subprocess.check_output(
 | 
						|
            ["git", "describe", "--tags", "--match=[0-9]*", "--always", "--dirty", "--long"],
 | 
						|
            stderr=subprocess.PIPE,
 | 
						|
            cwd=os.path.join(os.path.dirname(__file__), ".."),
 | 
						|
            text=True,
 | 
						|
        ).strip()
 | 
						|
    except (FileNotFoundError, subprocess.CalledProcessError):  # nocoverage
 | 
						|
        return None
 |