mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	Make password_auth_enabled() take a realm object
This will actually be used in an upcoming commit. (imported from commit 5d3db685a245899b2523440398f2ed2f0cfec4f4)
This commit is contained in:
		@@ -5,6 +5,10 @@ import ujson
 | 
			
		||||
from zproject.backends import password_auth_enabled
 | 
			
		||||
 | 
			
		||||
def add_settings(request):
 | 
			
		||||
    if hasattr(request.user, "realm"):
 | 
			
		||||
        is_pw_auth_enabled = password_auth_enabled(request.user.realm)
 | 
			
		||||
    else:
 | 
			
		||||
        is_pw_auth_enabled = True
 | 
			
		||||
    return {
 | 
			
		||||
        'full_navbar':   settings.FULL_NAVBAR,
 | 
			
		||||
        # We use the not_enterprise variable name so that templates
 | 
			
		||||
@@ -12,7 +16,7 @@ def add_settings(request):
 | 
			
		||||
        # to the template
 | 
			
		||||
        'not_enterprise':    not settings.ENTERPRISE,
 | 
			
		||||
        'zulip_admin':   settings.ZULIP_ADMINISTRATOR,
 | 
			
		||||
        'password_auth_enabled': password_auth_enabled(),
 | 
			
		||||
        'password_auth_enabled': is_pw_auth_enabled,
 | 
			
		||||
        'login_url':     settings.HOME_NOT_LOGGED_IN,
 | 
			
		||||
        'only_sso':     settings.ONLY_SSO,
 | 
			
		||||
        'external_api_path': settings.EXTERNAL_API_PATH,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user