Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
l y
Jumpserver
Commits
09d42281
Unverified
Commit
09d42281
authored
3 years ago
by
feng626
Committed by
GitHub
3 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #7102 from jumpserver/pr@dev@ticket_tips
perf: 工单错误提示优化
parents
2e4b6d15
3ae8da23
dev
dependabot/pip/requirements/ansible-4.2.0
feat_acl_muiltistrategy
feat_proxyterminal
master
pr@dev@escape_route
pr@dev@feat_custom_platform_auth_change
pr@dev@feat_custom_watermark
pr@dev@feat_rdp_chinese_username
pr@dev@feat_support_sqlserver_change_password
pr@dev@feat_ticket_serial
pr@dev@feat_user_view
pr@dev@fix_actions
pr@dev@fix_sms
pr@dev@fix_tcp_syslog
pr@dev@perf_base_model
pr@dev@share_session_link
pr@dev@ticket
pr@dev@ticket_flow_assignes
pr@dev@vault_secret
prr@dev@fix_ldapimport
repr@dev_v2.14_v2.15@2d6610b133512a3@fix_db_connection_not_close
v2.15
v2.16
v2.17
v2.18
v2.19
v2.20
v2.21
v2.22
v2.22.0
v2.21.4
v2.21.3
v2.21.2
v2.21.1
v2.21.0
v2.20.3
v2.20.2
v2.20.1
v2.20.0
v2.19.2
v2.19.1
v2.19.0
v2.18.3
v2.18.2
v2.18.1
v2.18.0
v2.17.5
v2.17.4
v2.17.3
v2.17.2
v2.17.1
v2.17.0
v2.16.3
v2.16.2
v2.16.1
v2.16.0
v2.15.5
v2.15.4
v2.15.3
v2.15.2
v2.15.1
v2.15.0
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/tickets/serializers/ticket/meta/ticket_type/apply_application.py
+7
-8
.../serializers/ticket/meta/ticket_type/apply_application.py
apps/tickets/serializers/ticket/ticket.py
+1
-1
apps/tickets/serializers/ticket/ticket.py
with
8 additions
and
9 deletions
+8
-9
apps/tickets/serializers/ticket/meta/ticket_type/apply_application.py
+
7
-
8
View file @
09d42281
...
...
@@ -80,12 +80,11 @@ class ApplySerializer(serializers.Serializer):
applications
=
Application
.
objects
.
filter
(
id__in
=
apply_applications
,
type
=
type
).
values_list
(
'id'
,
flat
=
True
)
return
list
(
applications
)
def
validate_apply_date_expired
(
self
,
value
):
date_start
=
self
.
root
.
initial_data
[
'meta'
].
get
(
'apply_date_start'
)
date_start
=
datetime
.
strptime
(
date_start
,
'%Y-%m-%dT%H:%M:%S.%fZ'
)
date_expired
=
self
.
root
.
initial_data
[
'meta'
].
get
(
'apply_date_expired'
)
date_expired
=
datetime
.
strptime
(
date_expired
,
'%Y-%m-%dT%H:%M:%S.%fZ'
)
if
date_expired
<=
date_start
:
def
validate
(
self
,
attrs
):
apply_date_start
=
attrs
[
'apply_date_start'
]
apply_date_expired
=
attrs
[
'apply_date_expired'
]
if
apply_date_expired
<=
apply_date_start
:
error
=
_
(
'The expiration date should be greater than the start date'
)
raise
serializers
.
ValidationError
(
error
)
return
value
raise
serializers
.
ValidationError
(
{
'apply_date_expired'
:
error
}
)
return
attrs
This diff is collapsed.
Click to expand it.
apps/tickets/serializers/ticket/ticket.py
+
1
-
1
View file @
09d42281
...
...
@@ -160,7 +160,7 @@ class TicketFlowApproveSerializer(serializers.ModelSerializer):
def
validate
(
self
,
attrs
):
if
attrs
[
'strategy'
]
==
TicketApprovalStrategy
.
custom_user
and
not
attrs
.
get
(
'assignees'
):
error
=
_
(
'Please select the Assignees'
)
raise
serializers
.
ValidationError
(
error
)
raise
serializers
.
ValidationError
(
{
'assignees'
:
error
}
)
return
super
().
validate
(
attrs
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help