blacked
This commit is contained in:
parent
8394a263c4
commit
364cf362f4
|
@ -11,22 +11,23 @@ from django.shortcuts import get_object_or_404
|
||||||
from django.utils import timezone as djangotime
|
from django.utils import timezone as djangotime
|
||||||
from django.views.decorators.csrf import csrf_exempt
|
from django.views.decorators.csrf import csrf_exempt
|
||||||
from redis import from_url
|
from redis import from_url
|
||||||
|
from rest_framework import serializers
|
||||||
|
from rest_framework import status as drf_status
|
||||||
from rest_framework.decorators import api_view, permission_classes
|
from rest_framework.decorators import api_view, permission_classes
|
||||||
from rest_framework.exceptions import PermissionDenied
|
from rest_framework.exceptions import PermissionDenied
|
||||||
from rest_framework.permissions import AllowAny, IsAuthenticated
|
from rest_framework.permissions import AllowAny, IsAuthenticated
|
||||||
from rest_framework.request import Request
|
from rest_framework.request import Request
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
from rest_framework import serializers, status as drf_status
|
|
||||||
|
|
||||||
from core.decorators import monitoring_view
|
from core.decorators import monitoring_view
|
||||||
from core.tasks import sync_mesh_perms_task
|
from core.tasks import sync_mesh_perms_task
|
||||||
from core.utils import (
|
from core.utils import (
|
||||||
get_core_settings,
|
get_core_settings,
|
||||||
sysd_svc_is_running,
|
|
||||||
token_is_valid,
|
|
||||||
run_server_script,
|
run_server_script,
|
||||||
run_test_url_rest_action,
|
run_test_url_rest_action,
|
||||||
|
sysd_svc_is_running,
|
||||||
|
token_is_valid,
|
||||||
)
|
)
|
||||||
from logs.models import AuditLog
|
from logs.models import AuditLog
|
||||||
from tacticalrmm.constants import AuditActionType, PAStatus
|
from tacticalrmm.constants import AuditActionType, PAStatus
|
||||||
|
@ -38,14 +39,13 @@ from tacticalrmm.permissions import (
|
||||||
)
|
)
|
||||||
|
|
||||||
from .models import CodeSignToken, CoreSettings, CustomField, GlobalKVStore, URLAction
|
from .models import CodeSignToken, CoreSettings, CustomField, GlobalKVStore, URLAction
|
||||||
|
|
||||||
from .permissions import (
|
from .permissions import (
|
||||||
CodeSignPerms,
|
CodeSignPerms,
|
||||||
CoreSettingsPerms,
|
CoreSettingsPerms,
|
||||||
CustomFieldPerms,
|
CustomFieldPerms,
|
||||||
|
RunServerScriptPerms,
|
||||||
ServerMaintPerms,
|
ServerMaintPerms,
|
||||||
URLActionPerms,
|
URLActionPerms,
|
||||||
RunServerScriptPerms,
|
|
||||||
WebTerminalPerms,
|
WebTerminalPerms,
|
||||||
)
|
)
|
||||||
from .serializers import (
|
from .serializers import (
|
||||||
|
@ -383,7 +383,7 @@ class RunURLAction(APIView):
|
||||||
|
|
||||||
from agents.models import Agent
|
from agents.models import Agent
|
||||||
from clients.models import Client, Site
|
from clients.models import Client, Site
|
||||||
from tacticalrmm.utils import get_db_value, RE_DB_VALUE
|
from tacticalrmm.utils import RE_DB_VALUE, get_db_value
|
||||||
|
|
||||||
if "agent_id" in request.data.keys():
|
if "agent_id" in request.data.keys():
|
||||||
if not _has_perm_on_agent(request.user, request.data["agent_id"]):
|
if not _has_perm_on_agent(request.user, request.data["agent_id"]):
|
||||||
|
@ -480,7 +480,6 @@ class RunTestURLAction(APIView):
|
||||||
debug_info={"ip": request._client_ip},
|
debug_info={"ip": request._client_ip},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
return Response({"url": replaced_url, "result": result, "body": replaced_body})
|
return Response({"url": replaced_url, "result": result, "body": replaced_body})
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union, cast, Literal
|
from typing import TYPE_CHECKING, Any, Dict, Literal, Optional, Tuple, Union, cast
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
from django.shortcuts import get_object_or_404
|
from django.shortcuts import get_object_or_404
|
||||||
from rest_framework.decorators import api_view, permission_classes
|
from rest_framework.decorators import api_view, permission_classes
|
||||||
from rest_framework.permissions import IsAuthenticated
|
from rest_framework.permissions import IsAuthenticated
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
from django.conf import settings
|
|
||||||
|
|
||||||
from agents.permissions import RunScriptPerms
|
from agents.permissions import RunScriptPerms
|
||||||
|
from core.utils import clear_entire_cache
|
||||||
|
from logs.models import AuditLog
|
||||||
from tacticalrmm.constants import ScriptShell, ScriptType
|
from tacticalrmm.constants import ScriptShell, ScriptType
|
||||||
from tacticalrmm.helpers import notify_error
|
from tacticalrmm.helpers import notify_error
|
||||||
|
|
||||||
from .models import Script, ScriptSnippet
|
from .models import Script, ScriptSnippet
|
||||||
from logs.models import AuditLog
|
|
||||||
from .permissions import ScriptsPerms
|
from .permissions import ScriptsPerms
|
||||||
from .serializers import (
|
from .serializers import (
|
||||||
ScriptSerializer,
|
ScriptSerializer,
|
||||||
ScriptSnippetSerializer,
|
ScriptSnippetSerializer,
|
||||||
ScriptTableSerializer,
|
ScriptTableSerializer,
|
||||||
)
|
)
|
||||||
from core.utils import clear_entire_cache
|
|
||||||
|
|
||||||
|
|
||||||
class GetAddScripts(APIView):
|
class GetAddScripts(APIView):
|
||||||
|
|
Loading…
Reference in New Issue