Skip to content

Commit 55deb53

Browse files
committed
feat: Поддержка stp_database 1.1
Signed-off-by: Roman Chursanov <[email protected]>
1 parent b884333 commit 55deb53

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

tgbot/handlers/head/group/game/history.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ async def head_transaction_detail_view(
149149
<b>📅 Дата создания</b>
150150
{transaction.created_at.strftime("%d.%m.%Y в %H:%M")}"""
151151

152-
if transaction.comment:
153-
message_text += f"\n\n<b>💬 Комментарий</b>\n<blockquote expandable>{transaction.comment}</blockquote>"
152+
if transaction.use:
153+
message_text += f"\n\n<b>💬 Комментарий</b>\n<blockquote expandable>{transaction.user_comment}</blockquote>"
154154

155155
await callback.message.edit_text(
156156
message_text, reply_markup=head_transaction_detail_kb(page)

tgbot/handlers/head/group/members.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,8 +909,8 @@ async def view_member_transaction_detail(
909909
<b>📅 Дата создания</b>
910910
{transaction.created_at.strftime("%d.%m.%Y в %H:%M")}"""
911911

912-
if transaction.comment:
913-
message_text += f"\n\n<b>💬 Комментарий</b>\n<blockquote expandable>{transaction.comment}</blockquote>"
912+
if transaction.user_comment:
913+
message_text += f"\n\n<b>💬 Комментарий</b>\n<blockquote expandable>{transaction.user_comment}</blockquote>"
914914

915915
await callback.message.edit_text(
916916
message_text,

tgbot/handlers/user/game/history.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ async def transaction_detail_view(
156156
<b>📅 Дата создания</b>
157157
{transaction.created_at.strftime("%d.%m.%Y в %H:%M")}"""
158158

159-
if transaction.comment:
160-
message_text += f"\n\n<b>💬 Комментарий</b>\n<blockquote expandable>{transaction.comment}</blockquote>"
159+
if transaction.user_comment:
160+
message_text += f"\n\n<b>💬 Комментарий</b>\n<blockquote expandable>{transaction.user_comment}</blockquote>"
161161

162162
await callback.message.edit_text(
163163
message_text, reply_markup=transaction_detail_kb(page)

tgbot/handlers/user/game/inventory.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ async def product_detail_view(
194194
<blockquote expandable><b>📅 Дата покупки</b>
195195
{user_product.bought_at.strftime("%d.%m.%Y в %H:%M")}</blockquote>"""
196196

197-
if user_product.comment:
198-
message_text += f"\n\n<b>💬 Комментарий</b>\n{user_product.comment}"
197+
if user_product.user_comment:
198+
message_text += f"\n\n<b>💬 Комментарий</b>\n{user_product.user_comment}"
199199

200200
if user_product.updated_by_user_id:
201201
manager = await stp_repo.employee.get_user(
@@ -289,8 +289,8 @@ async def product_detail_view_from_shop(
289289
<blockquote expandable><b>📅 Дата покупки</b>
290290
{user_product.bought_at.strftime("%d.%m.%Y в %H:%M")}</blockquote>"""
291291

292-
if user_product.comment:
293-
message_text += f"\n\n<b>💬 Комментарий</b>\n{user_product.comment}"
292+
if user_product.user_comment:
293+
message_text += f"\n\n<b>💬 Комментарий</b>\n{user_product.user_comment}"
294294

295295
if user_product.updated_by_user_id:
296296
manager = await stp_repo.employee.get_user(

tgbot/keyboards/admin/schedule/list.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from aiogram.filters.callback_data import CallbackData
44
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup
5-
from stp_database.models.STP.schedules import Schedules
5+
from stp_database.models import Schedule
66

77
from tgbot.keyboards.user.main import MainMenu
88

@@ -58,7 +58,7 @@ class RestoreConfirmMenu(CallbackData, prefix="admin_restore_confirm"):
5858

5959

6060
def list_db_files_paginated_kb(
61-
current_page: int, total_pages: int, page_files: Sequence[Schedules] = None
61+
current_page: int, total_pages: int, page_files: Sequence[Schedule] = None
6262
) -> InlineKeyboardMarkup:
6363
"""
6464
Клавиатура пагинации для файлов графиков в базе данных с кнопками выбора файлов.
@@ -179,7 +179,7 @@ def list_db_files_paginated_kb(
179179

180180

181181
def list_db_files_kb(
182-
schedule_files: Sequence[Schedules],
182+
schedule_files: Sequence[Schedule],
183183
) -> InlineKeyboardMarkup:
184184
"""
185185
Клавиатура меню файлов графиков в базе данных (legacy compatibility).
@@ -485,7 +485,7 @@ def schedule_list_back_kb() -> InlineKeyboardMarkup:
485485

486486

487487
def file_versions_list_kb(
488-
file_versions: Sequence[Schedules],
488+
file_versions: Sequence[Schedule],
489489
filename: str,
490490
current_page: int = 1,
491491
total_pages: int = 1,

tgbot/keyboards/mip/schedule/list.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from aiogram.filters.callback_data import CallbackData
44
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup
5-
from stp_database.models.STP.schedules import Schedules
5+
from stp_database.models.STP.schedule import Schedule
66

77
from tgbot.keyboards.user.main import MainMenu
88

@@ -58,7 +58,7 @@ class RestoreConfirmMenu(CallbackData, prefix="restore_confirm"):
5858

5959

6060
def list_db_files_paginated_kb(
61-
current_page: int, total_pages: int, page_files: Sequence[Schedules] = None
61+
current_page: int, total_pages: int, page_files: Sequence[Schedule] = None
6262
) -> InlineKeyboardMarkup:
6363
"""
6464
Клавиатура пагинации для файлов графиков в базе данных с кнопками выбора файлов.
@@ -179,7 +179,7 @@ def list_db_files_paginated_kb(
179179

180180

181181
def list_db_files_kb(
182-
schedule_files: Sequence[Schedules],
182+
schedule_files: Sequence[Schedule],
183183
) -> InlineKeyboardMarkup:
184184
"""
185185
Клавиатура меню файлов графиков в базе данных (legacy compatibility).
@@ -485,7 +485,7 @@ def schedule_list_back_kb() -> InlineKeyboardMarkup:
485485

486486

487487
def file_versions_list_kb(
488-
file_versions: Sequence[Schedules],
488+
file_versions: Sequence[Schedule],
489489
filename: str,
490490
current_page: int = 1,
491491
total_pages: int = 1,

0 commit comments

Comments
 (0)