Skip to content

Commit

Permalink
deleted filters for bot settings
Browse files Browse the repository at this point in the history
  • Loading branch information
bobr2072 committed Sep 2, 2023
1 parent 97819b2 commit 077be80
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 39 deletions.
36 changes: 18 additions & 18 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions requirements/develop.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ django==4.2.4 ; python_full_version >= "3.11.1" and python_version < "4.0"
dnspython==2.4.2 ; python_full_version >= "3.11.1" and python_version < "4.0"
email-validator==2.0.0.post2 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
factory-boy==3.3.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
faker==19.3.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
filelock==3.12.2 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
faker==19.3.1 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
filelock==3.12.3 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
flake8-docstrings==1.7.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
flake8==6.1.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
h11==0.14.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
Expand All @@ -35,7 +35,7 @@ nodeenv==1.8.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.
packaging==23.1 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pathspec==0.11.2 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
platformdirs==3.10.0 ; python_full_version >= "3.11.1" and python_version < "4.0"
pluggy==1.2.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pluggy==1.3.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pre-commit==3.3.3 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
psycopg2-binary==2.9.7 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pycodestyle==2.11.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
Expand Down Expand Up @@ -66,4 +66,4 @@ tzdata==2023.3 ; python_full_version >= "3.11.1" and python_version < "4.0" and
url-normalize==1.4.3 ; python_full_version >= "3.11.1" and python_version < "4.0"
urllib3==2.0.4 ; python_full_version >= "3.11.1" and python_version < "4.0"
uvicorn==0.23.2 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
virtualenv==20.24.3 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
virtualenv==20.24.4 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
2 changes: 1 addition & 1 deletion requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ iniconfig==2.0.0 ; python_full_version >= "3.11.1" and python_full_version < "4.
mccabe==0.7.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
packaging==23.1 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
platformdirs==3.10.0 ; python_full_version >= "3.11.1" and python_version < "4.0"
pluggy==1.2.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pluggy==1.3.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
psycopg2-binary==2.9.7 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pycodestyle==2.11.0 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
pydantic[email]==1.10.12 ; python_full_version >= "3.11.1" and python_full_version < "4.0.0"
Expand Down
16 changes: 0 additions & 16 deletions src/bot_settings/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
class BotSettingsAdmin(admin.ModelAdmin):
"""Base admin configuration for BotSettings model."""

list_display = ("get_title", "get_type", "get_value")
list_filter = ("type",)
search_fields = ("title", "type", "value")
readonly_fields = ("type",)
Expand All @@ -16,18 +15,3 @@ class BotSettingsAdmin(admin.ModelAdmin):
def has_delete_permission(self, request, obj=None):
"""Disable delete permission for BotSettings model."""
return False

@admin.display(description="Название настройки")
def get_title(self, obj):
"""Display title of settings in admin panel."""
return obj.title[:100]

@admin.display(description="Тип значения")
def get_type(self, obj):
"""Display type of settings in admin panel."""
return obj.get_type_display()[:100]

@admin.display(description="Значение настройки")
def get_value(self, obj):
"""Display value of settings in admin panel."""
return obj.value[:100]

0 comments on commit 077be80

Please sign in to comment.