Fixed linting
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
769785c299
commit
d16e7bb293
|
@ -8,6 +8,10 @@ import ceo.tui.utils as tui_utils
|
|||
from ceo.tui.views import TransactionView
|
||||
from ceod.transactions.members import UpdateMemberPositionsTransaction
|
||||
|
||||
from ceo_common.logger_factory import logger_factory
|
||||
|
||||
logger = logger_factory(__name__)
|
||||
|
||||
|
||||
class SetPositionsController(Controller):
|
||||
def __init__(self, model, app):
|
||||
|
@ -18,6 +22,7 @@ class SetPositionsController(Controller):
|
|||
for pos, field in self.view.position_fields.items():
|
||||
if field.edit_text != '':
|
||||
body[pos] = field.edit_text
|
||||
logger.info(body)
|
||||
model = TransactionModel(
|
||||
UpdateMemberPositionsTransaction.operations,
|
||||
'POST', '/api/positions', json=body
|
||||
|
|
|
@ -35,7 +35,7 @@ def update_positions():
|
|||
# remove falsy values and parse multiple users in each position
|
||||
# Example: "user1,user2, user3" -> ["user1","user2","user3"]
|
||||
body = {
|
||||
positions: username.replace(' ','').split(',') for positions, username in body.items()
|
||||
positions: username.replace(' ', '').split(',') for positions, username in body.items()
|
||||
if username
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ class UpdateMemberPositionsTransaction(AbstractTransaction):
|
|||
'subscribe_to_mailing_lists',
|
||||
]
|
||||
|
||||
def __init__(self, positions_reversed: Dict[str, Union[str,list]]):
|
||||
def __init__(self, positions_reversed: Dict[str, Union[str, list]]):
|
||||
# positions_reversed is position -> username
|
||||
super().__init__()
|
||||
self.ldap_srv = component.getUtility(ILDAPService)
|
||||
|
@ -36,7 +36,7 @@ class UpdateMemberPositionsTransaction(AbstractTransaction):
|
|||
self.positions[user].append(position)
|
||||
else:
|
||||
raise TypeError("Username(s) under each position must either be a string or a list")
|
||||
|
||||
|
||||
# a cached Dict of the Users who need to be modified (username -> User)
|
||||
self.users: Dict[str, IUser] = {}
|
||||
|
||||
|
|
Loading…
Reference in New Issue