Change make_engineer
This commit is contained in:
parent
f24c94914f
commit
276c979b73
@ -39,17 +39,17 @@ def update_role(user_profile: UserProfile, role: int, who_changes: get_user_mode
|
||||
zendesk.admin.users.update(user)
|
||||
|
||||
|
||||
def make_engineer(user_profile: UserProfile, who_changes: get_user_model()) -> None:
|
||||
def make_engineer(user_profile: UserProfile) -> None:
|
||||
"""
|
||||
Функция устанавливает пользователю роль инженера.
|
||||
|
||||
:param user_profile: Профиль пользователя
|
||||
:return: Вызов функции **update_role** с параметрами: профиль пользователя, роль "engineer"
|
||||
"""
|
||||
update_role(user_profile, ROLES['engineer'], who_changes)
|
||||
update_role(user_profile, ROLES['engineer'])
|
||||
|
||||
|
||||
def make_light_agent(user_profile: UserProfile, who_changes: get_user_model()) -> None:
|
||||
def make_light_agent(user_profile: UserProfile) -> None:
|
||||
"""
|
||||
Функция устанавливает пользователю роль легкого агента.
|
||||
|
||||
@ -76,7 +76,7 @@ def make_light_agent(user_profile: UserProfile, who_changes: get_user_model()) -
|
||||
attempts, success = 5, False
|
||||
while not success and attempts != 0:
|
||||
try:
|
||||
update_role(user_profile, ROLES['light_agent'], who_changes)
|
||||
update_role(user_profile, ROLES['light_agent'])
|
||||
success = True
|
||||
except APIException as e:
|
||||
attempts -= 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user