Merge branch 'dev' of github.com:jumpserver/jumpserver into dev

pull/4107/head
ibuler 2020-06-15 17:55:13 +08:00
commit e23bfa0f69
7 changed files with 2303 additions and 3873 deletions

View File

@ -34,7 +34,7 @@ class SystemUserSerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer):
'priority', 'username_same_with_user', 'priority', 'username_same_with_user',
'auto_push', 'cmd_filters', 'sudo', 'shell', 'comment', 'auto_push', 'cmd_filters', 'sudo', 'shell', 'comment',
'auto_generate_key', 'sftp_root', 'auto_generate_key', 'sftp_root',
'assets_amount', 'assets_amount', 'date_created', 'created_by'
] ]
extra_kwargs = { extra_kwargs = {
'password': {"write_only": True}, 'password': {"write_only": True},

View File

@ -58,6 +58,12 @@ class JMSCSVParser(BaseParser):
col = col.replace("", '"').replace("", '"').\ col = col.replace("", '"').replace("", '"').\
replace("", '"').replace('', '"').replace("'", '"') replace("", '"').replace('', '"').replace("'", '"')
col = json.loads(col) col = json.loads(col)
# 字典转换
if isinstance(col, str) and col.find("{") != -1 and col.find("}") != -1:
# 替换中文格式引号
col = col.replace("", '"').replace("", '"'). \
replace("", '"').replace('', '"').replace("'", '"')
col = json.loads(col)
_row.append(col) _row.append(col)
return _row return _row
@ -68,7 +74,7 @@ class JMSCSVParser(BaseParser):
""" """
_row_data = {} _row_data = {}
for k, v in row_data.items(): for k, v in row_data.items():
if isinstance(v, list) \ if isinstance(v, list) or isinstance(v, dict)\
or isinstance(v, str) and k.strip() and v.strip(): or isinstance(v, str) and k.strip() and v.strip():
_row_data[k] = v _row_data[k] = v
return _row_data return _row_data

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -13,7 +13,7 @@ class TicketSerializer(serializers.ModelSerializer):
model = models.Ticket model = models.Ticket
fields = [ fields = [
'id', 'user', 'user_display', 'title', 'body', 'id', 'user', 'user_display', 'title', 'body',
'assignees', 'assignees_display', 'assignees', 'assignees_display', 'assignee', 'assignee_display',
'status', 'action', 'date_created', 'date_updated', 'status', 'action', 'date_created', 'date_updated',
'type', 'type_display', 'action_display', 'type', 'type_display', 'action_display',
] ]

View File

@ -10,7 +10,7 @@
<div class="verify"> <div class="verify">
<p style="margin: 20px auto;"> <p style="margin: 20px auto;">
<strong style="color: #000000"> <strong style="color: #000000">
{% trans 'Download and install the Google Authenticator application on your phone' %} {% trans 'Download and install the Google Authenticator application on your phone or applet of WeChat' %}
</strong> </strong>
</p> </p>
<div> <div>