feat: Add periodic display and validate job params

This commit is contained in:
wangruidong
2024-11-20 20:12:46 +08:00
committed by ZhaoJiSen
parent 1a03f7b265
commit 6abfeee683
7 changed files with 153 additions and 125 deletions

View File

@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from django.db.models import Q
from django.utils.translation import gettext_lazy as _
from common.api.generic import JMSBulkModelViewSet
from common.utils.http import is_true
@@ -28,7 +29,7 @@ class AdHocViewSet(JMSBulkModelViewSet):
def check_object_permissions(self, request, obj):
if request.method != 'GET' and obj.creator != request.user:
self.permission_denied(
request, message={"detail": "Deleting other people's script is not allowed"}
request, message={"detail": _("Deleting other people's script is not allowed")}
)
return super().check_object_permissions(request, obj)