Merge branch 'feature/pylint' into feature/documentation
This commit is contained in:
commit
0be4c1b1ca
@ -39,17 +39,17 @@ def update_role(user_profile: UserProfile, role: int, who_changes: get_user_mode
|
|||||||
zendesk.admin.users.update(user)
|
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: Профиль пользователя
|
:param user_profile: Профиль пользователя
|
||||||
:return: Вызов функции **update_role** с параметрами: профиль пользователя, роль "engineer"
|
: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
|
attempts, success = 5, False
|
||||||
while not success and attempts != 0:
|
while not success and attempts != 0:
|
||||||
try:
|
try:
|
||||||
update_role(user_profile, ROLES['light_agent'], who_changes)
|
update_role(user_profile, ROLES['light_agent'])
|
||||||
success = True
|
success = True
|
||||||
except APIException as e:
|
except APIException as e:
|
||||||
attempts -= 1
|
attempts -= 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user