Compare commits

...

7 Commits

Author SHA1 Message Date
Jiangjie.Bai
fca15eae7f fix: 修复post方法调用AuthBook接口时500的问题 2022-06-22 17:10:20 +08:00
ibuler
2c63b56f62 perf: 修改 redis scan counter 2022-06-20 19:39:29 +08:00
Jiangjie.Bai
ea5e56b33e fix: 修复es类型的命令存储更新忽略证书字段不成功的问题 2022-06-20 14:47:10 +08:00
ibuler
e4819ffe11 pref: 去掉 django-redis-cache 依赖 2022-06-20 14:12:22 +08:00
Eric
c34302325f fix:修复es日期索引忽略证书的问题 2022-06-20 14:06:35 +08:00
Jiangjie.Bai
3b5ee06535 Merge pull request #8430 from jumpserver/pr@v2.23@fix_ticketaction
fix: 修复工单自定义搜索时500的问题
2022-06-17 15:25:03 +08:00
Jiangjie.Bai
8e5edfd179 fix: 修复工单自定义搜索时500的问题 2022-06-17 07:22:15 +00:00
5 changed files with 14 additions and 4 deletions

View File

@@ -53,7 +53,15 @@ class AccountSerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer):
return attrs
def get_protocols(self, v):
return v.protocols.replace(' ', ', ')
""" protocols 是 queryset 中返回的Post 创建成功后返回序列化时没有这个字段 """
if hasattr(v, 'protocols'):
protocols = v.protocols
elif hasattr(v, 'asset') and v.asset:
protocols = v.asset.protocols
else:
protocols = ''
protocols = protocols.replace(' ', ', ')
return protocols
@classmethod
def setup_eager_loading(cls, queryset):

View File

@@ -153,3 +153,5 @@ ANSIBLE_LOG_DIR = os.path.join(PROJECT_DIR, 'data', 'ansible')
REDIS_HOST = CONFIG.REDIS_HOST
REDIS_PORT = CONFIG.REDIS_PORT
REDIS_PASSWORD = CONFIG.REDIS_PASSWORD
DJANGO_REDIS_SCAN_ITERSIZE = 1000

View File

@@ -1,5 +1,6 @@
from __future__ import unicode_literals
import copy
import os
from importlib import import_module
@@ -77,7 +78,7 @@ class CommandStorage(CommonStorageModelMixin, CommonModelMixin):
def config(self):
config = self.meta
config.update({'TYPE': self.type})
return config
return copy.deepcopy(config)
@property
def valid_config(self):

View File

@@ -27,7 +27,7 @@ class TicketViewSet(CommonApiMixin, viewsets.ModelViewSet):
}
filterset_class = TicketFilter
search_fields = [
'title', 'action', 'type', 'status', 'applicant_display'
'title', 'type', 'status', 'applicant_display'
]
ordering_fields = (
'title', 'applicant_display', 'status', 'state', 'action_display',

View File

@@ -21,7 +21,6 @@ django-celery-beat==2.2.1
django-filter==2.4.0
django-formtools==2.2
django-ranged-response==0.2.0
django-redis-cache==2.1.1
django-rest-swagger==2.2.0
django-simple-captcha==0.5.13
django-timezone-field==4.1.0