mirror of https://github.com/jumpserver/jumpserver
feat: 修改ops api
parent
5e503ec5b8
commit
2c8f51940a
|
@ -16,7 +16,9 @@ class JobViewSet(OrgBulkModelViewSet):
|
|||
|
||||
def get_queryset(self):
|
||||
query_set = super().get_queryset()
|
||||
return query_set.filter(instant=False)
|
||||
if self.action != 'retrieve':
|
||||
return query_set.filter(instant=False)
|
||||
return query_set
|
||||
|
||||
def perform_create(self, serializer):
|
||||
instance = serializer.save()
|
||||
|
|
|
@ -91,6 +91,9 @@ class Job(JMSOrgBaseModel, PeriodTaskModelMixin):
|
|||
def create_execution(self):
|
||||
return self.executions.create()
|
||||
|
||||
class Meta:
|
||||
ordering = ['date_created']
|
||||
|
||||
|
||||
class JobExecution(JMSOrgBaseModel):
|
||||
id = models.UUIDField(default=uuid.uuid4, primary_key=True)
|
||||
|
@ -198,3 +201,6 @@ class JobExecution(JMSOrgBaseModel):
|
|||
except Exception as e:
|
||||
logging.error(e, exc_info=True)
|
||||
self.set_error(e)
|
||||
|
||||
class Meta:
|
||||
ordering = ['-date_created']
|
||||
|
|
Loading…
Reference in New Issue