From bc09371246073b46d441ae5ac95c225ea6dbb5a9 Mon Sep 17 00:00:00 2001
From: Ben Adida <ben@adida.net>
Date: Sat, 13 Feb 2021 17:38:32 +0000
Subject: [PATCH] auth systems should always be present, even if not enabled,
 otherwise emails can fail

---
 helios_auth/auth_systems/__init__.py | 44 ++++++----------------------
 1 file changed, 9 insertions(+), 35 deletions(-)

diff --git a/helios_auth/auth_systems/__init__.py b/helios_auth/auth_systems/__init__.py
index e9dc976..84382e8 100644
--- a/helios_auth/auth_systems/__init__.py
+++ b/helios_auth/auth_systems/__init__.py
@@ -1,42 +1,16 @@
 from django.conf import settings
-
-_enabled = settings.AUTH_ENABLED_SYSTEMS or None
-def _is_enabled(system):
-    return _enabled is None or system in _enabled
+from . import password, twitter, linkedin, cas, facebook, google, yahoo, clever
 
 AUTH_SYSTEMS = {}
 
-if _is_enabled('twitter'):
-    from . import twitter
-    AUTH_SYSTEMS['twitter'] = twitter
-
-if _is_enabled('linkedin'):
-    from . import linkedin
-    AUTH_SYSTEMS['linkedin'] = linkedin
-
-if _is_enabled('password'):
-    from . import password
-    AUTH_SYSTEMS['password'] = password
-
-if _is_enabled('cas'):
-    from . import cas
-    AUTH_SYSTEMS['cas'] = cas
-
-if _is_enabled('facebook'):
-    from . import facebook
-    AUTH_SYSTEMS['facebook'] = facebook
-
-if _is_enabled('google'):
-    from . import google
-    AUTH_SYSTEMS['google'] = google
-
-if _is_enabled('yahoo'):
-    from . import yahoo
-    AUTH_SYSTEMS['yahoo'] = yahoo
-
-if _is_enabled('clever'):
-    from . import clever
-    AUTH_SYSTEMS['clever'] = clever
+AUTH_SYSTEMS['password'] = password
+AUTH_SYSTEMS['twitter'] = twitter
+AUTH_SYSTEMS['linkedin'] = linkedin
+AUTH_SYSTEMS['cas'] = cas
+AUTH_SYSTEMS['facebook'] = facebook
+AUTH_SYSTEMS['google'] = google
+AUTH_SYSTEMS['yahoo'] = yahoo
+AUTH_SYSTEMS['clever'] = clever
 
 # not ready
 #import live
-- 
GitLab