mirror of
https://github.com/zulip/zulip.git
synced 2025-10-31 20:13:46 +00:00
Disable password change when SSO is the only login option
(imported from commit fd1a14237e2d6ea574331ed178bfc0db5beb18c6)
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.contrib.auth.backends import RemoteUserBackend
|
||||
import django.contrib.auth
|
||||
|
||||
from zerver.models import UserProfile, get_user_profile_by_id, \
|
||||
get_user_profile_by_email, remote_user_to_email
|
||||
|
||||
from openid.consumer.consumer import SUCCESS
|
||||
|
||||
def password_auth_enabled():
|
||||
for backend in django.contrib.auth.get_backends():
|
||||
if isinstance(backend, EmailAuthBackend):
|
||||
return True
|
||||
return False
|
||||
|
||||
class ZulipAuthMixin(object):
|
||||
def get_user(self, user_profile_id):
|
||||
""" Get a UserProfile object from the user_profile_id. """
|
||||
|
||||
Reference in New Issue
Block a user