Use pylint for zendesk_admin.py
This commit is contained in:
parent
e5460d90fc
commit
4666570177
@ -145,7 +145,7 @@ disable=print-statement,
|
||||
exception-escape,
|
||||
comprehension-escape,
|
||||
E5110,
|
||||
C045,
|
||||
C0415,
|
||||
|
||||
|
||||
# Enable the message, report, category or checker with the given id(s). You can
|
||||
@ -261,6 +261,9 @@ function-naming-style=snake_case
|
||||
|
||||
# Good variable names which should always be accepted, separated by a comma.
|
||||
good-names=i,
|
||||
id,
|
||||
e,
|
||||
n,
|
||||
j,
|
||||
k,
|
||||
ex,
|
||||
|
@ -1,3 +1,7 @@
|
||||
"""
|
||||
Функционал работы администратора Zendesk.
|
||||
"""
|
||||
|
||||
from typing import Optional, Dict
|
||||
|
||||
from zenpy import Zenpy
|
||||
@ -35,7 +39,7 @@ class ZendeskAdmin:
|
||||
:param email: Email пользователя
|
||||
:return: Является ли зарегистрированным
|
||||
"""
|
||||
return True if self.admin.search(email, type='user') else False
|
||||
return bool(self.admin.search(email, type='user'))
|
||||
|
||||
def get_user(self, email: str) -> ZenpyUser:
|
||||
"""
|
||||
@ -85,9 +89,8 @@ class ZendeskAdmin:
|
||||
admin = Zenpy(**self.credentials)
|
||||
try:
|
||||
admin.search(self.credentials['email'], type='user')
|
||||
except APIException:
|
||||
raise ValueError('invalid access_controller`s login data')
|
||||
|
||||
except APIException as invalid_data:
|
||||
raise ValueError('invalid access_controller`s login data') from invalid_data
|
||||
return admin
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user