diff --git a/.pylintrc b/.pylintrc index efe65af..49866c6 100644 --- a/.pylintrc +++ b/.pylintrc @@ -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, diff --git a/main/zendesk_admin.py b/main/zendesk_admin.py index 9d83109..6e2a5b3 100644 --- a/main/zendesk_admin.py +++ b/main/zendesk_admin.py @@ -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