- Introduced `DependenciesMiddleware` and `BlacklistMiddleware` for enhanced request handling across all routers. - Refactored admin handlers to utilize new middleware, improving access control and error handling. - Updated the `admin_router` to include middleware for access checks and streamlined the process of banning users. - Enhanced the structure of admin handler imports for better organization and maintainability. - Improved error handling in various admin functions to ensure robust user interactions.
25 lines
693 B
Python
25 lines
693 B
Python
from .callback_handlers import callback_router
|
|
from .services import PostPublishService, BanService
|
|
from .exceptions import UserBlockedBotError, PostNotFoundError, UserNotFoundError, PublishError, BanError
|
|
from .constants import (
|
|
CALLBACK_PUBLISH, CALLBACK_DECLINE, CALLBACK_BAN, CALLBACK_UNLOCK,
|
|
CALLBACK_RETURN, CALLBACK_PAGE
|
|
)
|
|
|
|
__all__ = [
|
|
'callback_router',
|
|
'PostPublishService',
|
|
'BanService',
|
|
'UserBlockedBotError',
|
|
'PostNotFoundError',
|
|
'UserNotFoundError',
|
|
'PublishError',
|
|
'BanError',
|
|
'CALLBACK_PUBLISH',
|
|
'CALLBACK_DECLINE',
|
|
'CALLBACK_BAN',
|
|
'CALLBACK_UNLOCK',
|
|
'CALLBACK_RETURN',
|
|
'CALLBACK_PAGE'
|
|
]
|