switch to uv and add cors headers

This commit is contained in:
2025-07-25 01:23:29 +03:00
parent 0ea2ca744a
commit 7f47ac6849
30 changed files with 3326 additions and 2849 deletions

View File

@@ -16,7 +16,6 @@ from bots.models import TelegramBot
from bots.modules import BOT_MODULES
from bots.utils import BaseBotConfigView, JSONResponseMixin, AjaxResponseMixin
from cabinet.utils import CabinetViewMixin
from config.utils import AllowCORSMixin
class BotListView(CabinetViewMixin, ListView):
@@ -84,7 +83,7 @@ class BotConfigDeleteView(LoginRequiredMixin, SingleObjectMixin, View):
return redirect('cabinet:bots:index')
class BotRPCView(JSONResponseMixin, AjaxResponseMixin, AllowCORSMixin, View):
class BotRPCView(JSONResponseMixin, AjaxResponseMixin, View):
@method_decorator(csrf_exempt)
def dispatch(self, request, *args, **kwargs):
return super().dispatch(request, *args, **kwargs)
@@ -95,5 +94,4 @@ class BotRPCView(JSONResponseMixin, AjaxResponseMixin, AllowCORSMixin, View):
raise PermissionDenied()
rpc_response = JSONRPCResponseManager.handle(request.body, bot.config.rpc_dispatcher)
response = self.render_json_response(rpc_response.data)
self.add_access_control_headers(response)
return response