4
4
from flask import Blueprint , current_app as app , flash , jsonify , redirect , render_template , request , session , url_for
5
5
from flask_babel import format_datetime
6
6
from kqueen_ui .api import get_kqueen_client
7
- from kqueen_ui .config . auth import AuthModules
7
+ from kqueen_ui .auth import AUTH_MODULES
8
8
from kqueen_ui .auth import generate_confirmation_token
9
9
from kqueen_ui .blueprints .ui .utils import generate_password , sanitize_resource_metadata
10
10
from kqueen_ui .generic_views import KQueenView
@@ -171,13 +171,11 @@ class MemberCreate(KQueenView):
171
171
def handle (self , organization_id ):
172
172
form_cls = MemberCreateForm
173
173
174
- modules = AuthModules ()
175
- auth_options = modules .__dict__
176
- logger .debug ('Available Auth options {}' .format (auth_options ))
174
+ logger .debug ('Available Auth options {}' .format (AUTH_MODULES ))
177
175
178
- if auth_options :
176
+ if AUTH_MODULES :
179
177
auth_choices = []
180
- for name , options in auth_options .items ():
178
+ for name , options in AUTH_MODULES .items ():
181
179
choice = (name , options .get ('label' , name ))
182
180
auth_choices .append (choice )
183
181
field_kw = {
@@ -197,7 +195,7 @@ def handle(self, organization_id):
197
195
notify = True
198
196
if hasattr (form , 'auth_method' ):
199
197
auth_method = form .auth_method .data
200
- notify = auth_options .get (auth_method , {}).get ('notify' , True )
198
+ notify = AUTH_MODULES .get (auth_method , {}).get ('notify' , True )
201
199
password = ''
202
200
active = True
203
201
if auth_method == 'local' :
0 commit comments