diff --git a/user_managment/app.py b/user_managment/app.py index f280330..f896506 100644 --- a/user_managment/app.py +++ b/user_managment/app.py @@ -41,7 +41,7 @@ def get_ids(callsign): url = "https://www.radioid.net" response = requests.get(url+"/api/dmr/user/?callsign=" + callsign) result = response.json() - print(result) +## print(result) # id_list = [] id_list = {} f_name = result['results'][0]['fname'] @@ -180,10 +180,11 @@ def create_app(): @user_registered.connect_via(app) def _after_user_registered_hook(sender, user, **extra): edit_user = User.query.filter(User.username == user.username).first() - edit_user.dmr_ids = str(ast.literal_eval(get_ids(user.username))[0]) - edit_user.first_name = str(ast.literal_eval(get_ids(user.username))[1]) - edit_user.last_name = str(ast.literal_eval(get_ids(user.username))[2]) - edit_user.city = str(ast.literal_eval(get_ids(user.username))[3]) + radioid_data = ast.literal_eval(get_ids(user.username)) + edit_user.dmr_ids = str(radioid_data[0]) + edit_user.first_name = str(radioid_data[1]) + edit_user.last_name = str(radioid_data[2]) + edit_user.city = str(radioid_data[3]) user_role = UserRoles( user_id=edit_user.id, role_id=2, @@ -412,8 +413,8 @@ def create_app():