Add pylint, add init-file in access_controller folder to run pylint

This commit is contained in:
Степаненко Ольга 2021-04-27 12:10:29 +03:00
parent 68833ccdd5
commit bd8ba97a46
5 changed files with 10 additions and 8 deletions

View File

@ -147,6 +147,8 @@ docker run -d -p 8000:8000 \
## Параметры тестовой песочницы:
Пример полной конфигурации можно найти в [.env.example](.env.example). Почту и токен админа ZenDesk взять у руководителя (если вы не админ).
## Для проверки pylint используем:
pylint --load-plugins pylint_django ../access_controller
## Read more
- Zenpy: [http://docs.facetoe.com.au](http://docs.facetoe.com.au)

0
__init__.py Normal file
View File

View File

@ -134,15 +134,12 @@ extensions = {
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
'sphinx_rtd_theme',
'sphinx.ext.graphviz',
'sphinx.ext.inheritance_diagram',
'sphinx_autodoc_typehints',
'sphinxcontrib.spelling',
# 'm2r'
}
@ -193,7 +190,7 @@ autodoc_typehints = "description"
# spell checking
spelling_lang = 'ru_RU'
tokenizer_lang = 'ru_RU'
spelling_exclude_patterns=['ignored_*']
spelling_exclude_patterns=['ignored_*', '../../main/models.py']
spelling_show_suggestions = True
spelling_show_whole_line=True
spelling_warning=True
@ -213,5 +210,5 @@ typehints_fully_qualified = True
always_document_param_types = True
typehints_document_rtype = True
napoleon_attr_annotations = True

View File

@ -49,12 +49,13 @@ class RoleChangeLogs(models.Model):
"""
Модель для логирования изменений ролей пользователя.
"""
user = models.ForeignKey(to=User, on_delete=models.CASCADE, help_text='Пользователь, которому присвоили другую роль')
user = models.ForeignKey(to=User, on_delete=models.CASCADE,
help_text='Пользователь, которому присвоили другую роль')
old_role = models.IntegerField(default=0, help_text='Старая роль')
new_role = models.IntegerField(default=0, help_text='Присвоенная роль')
change_time = models.DateTimeField(default=timezone.now, help_text='Дата и время изменения роли')
changed_by = models.ForeignKey(to=User, on_delete=models.CASCADE, related_name='changed_by', help_text='Кем была изменена роль')
changed_by = models.ForeignKey(to=User, on_delete=models.CASCADE, related_name='changed_by',
help_text='Кем была изменена роль')
class UnassignedTicketStatus(models.IntegerChoices):

View File

@ -15,3 +15,5 @@ sphinx-autodoc-typehints==1.11.1
pyenchant==3.2.0
sphinxcontrib-spelling==7.1.0
m2r == 0.2.1
pylint == 2.8.2
pylint-django == 2.4.4