diff --git a/docs/source/conf.py b/docs/source/conf.py index 7e99943..d45b1cd 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -132,6 +132,7 @@ extensions = { 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode', + 'sphinx.ext.napoleon', 'sphinx_rtd_theme', 'sphinx.ext.graphviz', 'sphinx.ext.inheritance_diagram', @@ -205,3 +206,5 @@ set_type_checking_flag = True typehints_fully_qualified = True always_document_param_types = True typehints_document_rtype = True + +napoleon_attr_annotations = True diff --git a/main/extra_func.py b/main/extra_func.py index 758875a..27986c8 100644 --- a/main/extra_func.py +++ b/main/extra_func.py @@ -114,7 +114,7 @@ class ZendeskAdmin: user = self.admin.users.search(email).values[0] return user.organization.name if user.organization else None - def create_admin(self) -> Zenpy: + def create_admin(self) -> None: """ Функция создает администратора, проверяя наличие вводимых данных в env. @@ -141,7 +141,7 @@ class ZendeskAdmin: raise ValueError('invalid access_controller`s login data') -def update_role(user_profile: UserProfile, role: int) -> UserProfile: +def update_role(user_profile: UserProfile, role: int) -> None: """ Функция меняет роль пользователя. @@ -157,7 +157,7 @@ def update_role(user_profile: UserProfile, role: int) -> UserProfile: zendesk.admin.users.update(user) -def make_engineer(user_profile: UserProfile, who_changes: User) -> UserProfile: +def make_engineer(user_profile: UserProfile, who_changes: User) -> None: """ Функция устанавливает пользователю роль инженера. @@ -167,7 +167,7 @@ def make_engineer(user_profile: UserProfile, who_changes: User) -> UserProfile: update_role(user_profile, ROLES['engineer']) -def make_light_agent(user_profile: UserProfile, who_changes: User) -> UserProfile: +def make_light_agent(user_profile: UserProfile, who_changes: User) -> None: """ Функция устанавливает пользователю роль легкого агента. diff --git a/main/forms.py b/main/forms.py index 613fc34..22bd76b 100644 --- a/main/forms.py +++ b/main/forms.py @@ -14,7 +14,7 @@ class CustomRegistrationForm(RegistrationFormUniqueEmail): :type visible_fields.email: :class:`django_registration.forms.RegistrationFormUniqueEmail` """ - def __init__(self, *args, **kwargs) -> RegistrationFormUniqueEmail: + def __init__(self, *args, **kwargs) -> None: super().__init__(*args, **kwargs) for visible in self.visible_fields(): if visible.field.widget.attrs.get('class', False):