Skip to content
Merged
Show file tree
Hide file tree
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
fix: TT-131 remove role field
  • Loading branch information
Angeluz-07 committed Jan 26, 2021
commit 2fea9be4939bcd5bd3cd021b30fa70c0057cf12d
1 change: 0 additions & 1 deletion tests/time_tracker_api/users/users_namespace_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from flask import json
from flask.testing import FlaskClient
from flask_restplus._http import HTTPStatus
from utils.azure_users import AzureConnection
from pytest import mark


Expand Down
22 changes: 1 addition & 21 deletions time_tracker_api/users/users_namespace.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from faker import Faker
from flask_restplus import fields, Resource
from flask_restplus._http import HTTPStatus

from time_tracker_api.api import common_fields, api, NullableString
from time_tracker_api.api import common_fields, api
from time_tracker_api.security import current_user_id

from utils.azure_users import AzureConnection
Expand All @@ -26,12 +25,6 @@
description='Email of the user that belongs to the tenant',
example=Faker().email(),
),
'role': NullableString(
title="User's Role",
max_length=50,
description='Role assigned to the user by the tenant',
example=Faker().word(['time-tracker-admin']),
),
'roles': fields.List(
fields.String(
title='Roles',
Expand All @@ -46,19 +39,6 @@

user_response_fields.update(common_fields)

user_role_input_fields = ns.model(
'UserRoleInput',
{
'role': NullableString(
title="User's Role",
required=True,
max_length=50,
description='Role assigned to the user by the tenant',
example=Faker().word(['time-tracker-admin']),
),
},
)


@ns.route('')
class Users(Resource):
Expand Down
2 changes: 0 additions & 2 deletions utils/azure_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ def __init__(self, config=MSConfig):
self.config = config
self.access_token = self.get_token()

self.role_field = 'extension_1d76efa96f604499acc0c0ee116a1453_role'

def get_token(self):
response = self.client.acquire_token_for_client(
scopes=self.config.SCOPE
Expand Down