Skip to content

Commit ed781e5

Browse files
committed
fix: instance on demand the azure connection proxy
1 parent c9e842c commit ed781e5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

time_tracker_api/users/users_namespace.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
from utils.azure_users import AzureConnection
88

99

10-
azure_connection = AzureConnection()
11-
1210
ns = api.namespace('users', description='Namespace of the API for users')
1311

1412
# User Model
@@ -59,7 +57,7 @@ class Users(Resource):
5957
@ns.marshal_list_with(user_response_fields)
6058
def get(self):
6159
"""List all users"""
62-
return azure_connection.users()
60+
return AzureConnection().users()
6361

6462

6563
@ns.route('/<string:id>/roles')
@@ -75,7 +73,7 @@ class UserRoles(Resource):
7573
@ns.marshal_with(user_response_fields)
7674
def post(self, id):
7775
"""Create user's role"""
78-
return azure_connection.update_user_role(id, ns.payload['role'])
76+
return AzureConnection().update_user_role(id, ns.payload['role'])
7977

8078

8179
@ns.route('/<string:user_id>/roles/<string:role_id>')
@@ -88,4 +86,4 @@ class UserRole(Resource):
8886
@ns.marshal_with(user_response_fields)
8987
def delete(self, user_id, role_id):
9088
"""Delete user's role"""
91-
return azure_connection.update_user_role(user_id, role=None)
89+
return AzureConnection().update_user_role(user_id, role=None)

0 commit comments

Comments
 (0)