fix isort
This commit is contained in:
@@ -1,19 +1,8 @@
|
||||
from .callback_handlers import callback_router
|
||||
from .constants import (
|
||||
CALLBACK_BAN,
|
||||
CALLBACK_DECLINE,
|
||||
CALLBACK_PAGE,
|
||||
CALLBACK_PUBLISH,
|
||||
CALLBACK_RETURN,
|
||||
CALLBACK_UNLOCK,
|
||||
)
|
||||
from .exceptions import (
|
||||
BanError,
|
||||
PostNotFoundError,
|
||||
PublishError,
|
||||
UserBlockedBotError,
|
||||
UserNotFoundError,
|
||||
)
|
||||
from .constants import (CALLBACK_BAN, CALLBACK_DECLINE, CALLBACK_PAGE,
|
||||
CALLBACK_PUBLISH, CALLBACK_RETURN, CALLBACK_UNLOCK)
|
||||
from .exceptions import (BanError, PostNotFoundError, PublishError,
|
||||
UserBlockedBotError, UserNotFoundError)
|
||||
from .services import BanService, PostPublishService
|
||||
|
||||
__all__ = [
|
||||
|
||||
@@ -11,45 +11,25 @@ from aiogram.types import CallbackQuery
|
||||
from helper_bot.handlers.admin.utils import format_user_info
|
||||
from helper_bot.handlers.voice.constants import CALLBACK_DELETE, CALLBACK_SAVE
|
||||
from helper_bot.handlers.voice.services import AudioFileService
|
||||
from helper_bot.keyboards.keyboards import (
|
||||
create_keyboard_for_ban_reason,
|
||||
create_keyboard_with_pagination,
|
||||
get_reply_keyboard_admin,
|
||||
)
|
||||
from helper_bot.keyboards.keyboards import (create_keyboard_for_ban_reason,
|
||||
create_keyboard_with_pagination,
|
||||
get_reply_keyboard_admin)
|
||||
from helper_bot.utils.base_dependency_factory import get_global_instance
|
||||
from helper_bot.utils.helper_func import get_banned_users_buttons, get_banned_users_list
|
||||
|
||||
from helper_bot.utils.helper_func import (get_banned_users_buttons,
|
||||
get_banned_users_list)
|
||||
# Local imports - metrics
|
||||
from helper_bot.utils.metrics import (
|
||||
db_query_time,
|
||||
track_errors,
|
||||
track_file_operations,
|
||||
track_time,
|
||||
)
|
||||
from helper_bot.utils.metrics import (db_query_time, track_errors,
|
||||
track_file_operations, track_time)
|
||||
from logs.custom_logger import logger
|
||||
|
||||
from .constants import (
|
||||
CALLBACK_BAN,
|
||||
CALLBACK_DECLINE,
|
||||
CALLBACK_PAGE,
|
||||
CALLBACK_PUBLISH,
|
||||
CALLBACK_RETURN,
|
||||
CALLBACK_UNLOCK,
|
||||
ERROR_BOT_BLOCKED,
|
||||
MESSAGE_DECLINED,
|
||||
MESSAGE_ERROR,
|
||||
MESSAGE_PUBLISHED,
|
||||
MESSAGE_USER_BANNED,
|
||||
MESSAGE_USER_UNLOCKED,
|
||||
)
|
||||
from .constants import (CALLBACK_BAN, CALLBACK_DECLINE, CALLBACK_PAGE,
|
||||
CALLBACK_PUBLISH, CALLBACK_RETURN, CALLBACK_UNLOCK,
|
||||
ERROR_BOT_BLOCKED, MESSAGE_DECLINED, MESSAGE_ERROR,
|
||||
MESSAGE_PUBLISHED, MESSAGE_USER_BANNED,
|
||||
MESSAGE_USER_UNLOCKED)
|
||||
from .dependency_factory import get_ban_service, get_post_publish_service
|
||||
from .exceptions import (
|
||||
BanError,
|
||||
PostNotFoundError,
|
||||
PublishError,
|
||||
UserBlockedBotError,
|
||||
UserNotFoundError,
|
||||
)
|
||||
from .exceptions import (BanError, PostNotFoundError, PublishError,
|
||||
UserBlockedBotError, UserNotFoundError)
|
||||
|
||||
callback_router = Router()
|
||||
|
||||
|
||||
@@ -6,47 +6,27 @@ from aiogram import Bot, types
|
||||
from aiogram.types import CallbackQuery
|
||||
|
||||
from helper_bot.keyboards.keyboards import create_keyboard_for_ban_reason
|
||||
from helper_bot.utils.helper_func import (
|
||||
delete_user_blacklist,
|
||||
get_text_message,
|
||||
send_audio_message,
|
||||
send_media_group_to_channel,
|
||||
send_photo_message,
|
||||
send_text_message,
|
||||
send_video_message,
|
||||
send_video_note_message,
|
||||
send_voice_message,
|
||||
)
|
||||
|
||||
from helper_bot.utils.helper_func import (delete_user_blacklist,
|
||||
get_text_message, send_audio_message,
|
||||
send_media_group_to_channel,
|
||||
send_photo_message,
|
||||
send_text_message,
|
||||
send_video_message,
|
||||
send_video_note_message,
|
||||
send_voice_message)
|
||||
# Local imports - metrics
|
||||
from helper_bot.utils.metrics import (
|
||||
db_query_time,
|
||||
track_errors,
|
||||
track_media_processing,
|
||||
track_time,
|
||||
)
|
||||
from helper_bot.utils.metrics import (db_query_time, track_errors,
|
||||
track_media_processing, track_time)
|
||||
from logs.custom_logger import logger
|
||||
|
||||
from .constants import (
|
||||
CONTENT_TYPE_AUDIO,
|
||||
CONTENT_TYPE_MEDIA_GROUP,
|
||||
CONTENT_TYPE_PHOTO,
|
||||
CONTENT_TYPE_TEXT,
|
||||
CONTENT_TYPE_VIDEO,
|
||||
CONTENT_TYPE_VIDEO_NOTE,
|
||||
CONTENT_TYPE_VOICE,
|
||||
ERROR_BOT_BLOCKED,
|
||||
MESSAGE_POST_DECLINED,
|
||||
MESSAGE_POST_PUBLISHED,
|
||||
MESSAGE_USER_BANNED_SPAM,
|
||||
)
|
||||
from .exceptions import (
|
||||
BanError,
|
||||
PostNotFoundError,
|
||||
PublishError,
|
||||
UserBlockedBotError,
|
||||
UserNotFoundError,
|
||||
)
|
||||
from .constants import (CONTENT_TYPE_AUDIO, CONTENT_TYPE_MEDIA_GROUP,
|
||||
CONTENT_TYPE_PHOTO, CONTENT_TYPE_TEXT,
|
||||
CONTENT_TYPE_VIDEO, CONTENT_TYPE_VIDEO_NOTE,
|
||||
CONTENT_TYPE_VOICE, ERROR_BOT_BLOCKED,
|
||||
MESSAGE_POST_DECLINED, MESSAGE_POST_PUBLISHED,
|
||||
MESSAGE_USER_BANNED_SPAM)
|
||||
from .exceptions import (BanError, PostNotFoundError, PublishError,
|
||||
UserBlockedBotError, UserNotFoundError)
|
||||
|
||||
|
||||
class PostPublishService:
|
||||
|
||||
Reference in New Issue
Block a user