switch to uv and add cors headers
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user