Skip to content

Commit

Permalink
some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstantinRaikhert committed Sep 1, 2023
1 parent 31b7b71 commit 7ea78aa
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 20 deletions.
19 changes: 2 additions & 17 deletions src/bot/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class QuestionAdmin(RegionForAdmin):
form = QuestionAdminForm
list_display = (
"get_question",
"get_short_description",
"get_question_type",
"short_description",
"question_type",
"get_answer",
"get_regions",
)
Expand All @@ -41,16 +41,6 @@ def get_question(self, obj):
"""Display questions in admin panel."""
return obj.question[:100]

@admin.display(description="Текст на кнопке")
def get_short_description(self, obj):
"""Display short_descriptions in admin panel."""
return obj.short_description[:100]

@admin.display(description="Тип вопроса")
def get_question_type(self, obj):
"""Display question_type in admin panel."""
return obj.get_question_type_display()[:100]

@admin.display(description="Ответ")
def get_answer(self, obj):
"""Display answer in admin panel."""
Expand Down Expand Up @@ -95,11 +85,6 @@ def get_title(self, obj):
"""Display title in admin panel."""
return obj.title[:100]

@admin.display(description="Текст на кнопке")
def get_short_description(self, obj):
"""Display short_description in admin panel."""
return obj.short_description[:100]

@admin.display(description="Описание программы")
def get_fund_text(self, obj):
"""Display fund_text in admin panel."""
Expand Down
3 changes: 1 addition & 2 deletions src/bot/handlers/assistance.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
)
from bot.keyboards.assistance_types import assistance_types_keyboard_markup
from bot.keyboards.utils.callback_data_parse import parse_callback_data
from bot.models import HelpTypes
from bot_settings.models import BotSettings

DEFAULT_PAGE = 1
Expand Down Expand Up @@ -139,7 +138,7 @@ async def contact_with_us(
) -> States:
"""Ask question and show contacts."""
query = update.callback_query
context.user_data[States.QUESTION_TYPE] = HelpTypes.COMMON_QUESTION.value
context.user_data[States.QUESTION_TYPE] = "COMMON_QUESTION"
await query.answer()
await query.edit_message_text(
text=CONTACT_SHOW_MESSAGE,
Expand Down
23 changes: 23 additions & 0 deletions src/bot/migrations/0007_alter_question_short_description.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.4 on 2023-09-01 15:43

from django.db import migrations, models


class Migration(migrations.Migration):
"""Migrations for bot."""

dependencies = [
("bot", "0006_alter_fundprogram_short_description_and_more"),
]

operations = [
migrations.AlterField(
model_name="question",
name="short_description",
field=models.CharField(
help_text="Введите название кнопки в боте для данного вопроса",
max_length=20,
verbose_name="Текст на кнопке",
),
),
]
2 changes: 1 addition & 1 deletion src/bot/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Question(BaseModel):
)
short_description = models.CharField(
max_length=20,
verbose_name="Короткое описание",
verbose_name="Текст на кнопке",
help_text="Введите название кнопки в боте для данного вопроса",
)
regions = models.ManyToManyField(
Expand Down

0 comments on commit 7ea78aa

Please sign in to comment.