Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TT-112 feat: add feature toggle
  • Loading branch information
Angeluz-07 committed Jan 12, 2021
commit 79ffbeab25f7e3826b0ddaa0478906ebd0f70f33
8 changes: 6 additions & 2 deletions time_tracker_api/users/users_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from time_tracker_api.api import common_fields, api, NullableString

from utils.azure_users import AzureConnection

from commons.feature_toggles.feature_toggle_manager import FeatureToggleManager

ns = api.namespace('users', description='Namespace of the API for users')

Expand Down Expand Up @@ -66,7 +66,11 @@ class Users(Resource):
@ns.marshal_list_with(user_response_fields)
def get(self):
"""List all users"""
return AzureConnection().users_v2()
ftm = FeatureToggleManager('bk-user-role-field')
if ftm.is_toggle_enabled_for_user():
return AzureConnection().users_v2()
else:
return AzureConnection().users()


@ns.route('/<string:id>/roles')
Expand Down