Fix type hints

This commit is contained in:
Andrew Smirnov 2021-04-15 19:55:34 +03:00
parent afec8e59e4
commit 18cc98f11a
No known key found for this signature in database
GPG Key ID: 0EFE318E5BB2A82A
3 changed files with 8 additions and 5 deletions

View File

@ -132,6 +132,7 @@ extensions = {
'sphinx.ext.autodoc', 'sphinx.ext.autodoc',
'sphinx.ext.intersphinx', 'sphinx.ext.intersphinx',
'sphinx.ext.viewcode', 'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
'sphinx_rtd_theme', 'sphinx_rtd_theme',
'sphinx.ext.graphviz', 'sphinx.ext.graphviz',
'sphinx.ext.inheritance_diagram', 'sphinx.ext.inheritance_diagram',
@ -205,3 +206,5 @@ set_type_checking_flag = True
typehints_fully_qualified = True typehints_fully_qualified = True
always_document_param_types = True always_document_param_types = True
typehints_document_rtype = True typehints_document_rtype = True
napoleon_attr_annotations = True

View File

@ -114,7 +114,7 @@ class ZendeskAdmin:
user = self.admin.users.search(email).values[0] user = self.admin.users.search(email).values[0]
return user.organization.name if user.organization else None return user.organization.name if user.organization else None
def create_admin(self) -> Zenpy: def create_admin(self) -> None:
""" """
Функция создает администратора, проверяя наличие вводимых данных в env. Функция создает администратора, проверяя наличие вводимых данных в env.
@ -141,7 +141,7 @@ class ZendeskAdmin:
raise ValueError('invalid access_controller`s login data') 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) 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']) 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:
""" """
Функция устанавливает пользователю роль легкого агента. Функция устанавливает пользователю роль легкого агента.

View File

@ -14,7 +14,7 @@ class CustomRegistrationForm(RegistrationFormUniqueEmail):
:type visible_fields.email: :class:`django_registration.forms.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) super().__init__(*args, **kwargs)
for visible in self.visible_fields(): for visible in self.visible_fields():
if visible.field.widget.attrs.get('class', False): if visible.field.widget.attrs.get('class', False):