mirror of https://github.com/jumpserver/jumpserver
Merge pull request #6862 from jumpserver/pr@dev@ticket_time_validation
fix: 工单失效日期小于开始日期pull/6865/head
commit
aa6dcdc65d
|
@ -69,5 +69,9 @@ class ApplySerializer(serializers.Serializer):
|
|||
'Permission named `{}` already exists'.format(permission_name)
|
||||
))
|
||||
|
||||
|
||||
|
||||
def validate_apply_date_expired(self, apply_date_expired):
|
||||
apply_date_start = self.root.initial_data['meta'].get('apply_date_start')
|
||||
if str(apply_date_expired) <= apply_date_start:
|
||||
error = _('The expiration date should be greater than the start date')
|
||||
raise serializers.ValidationError(error)
|
||||
return apply_date_expired
|
||||
|
|
|
@ -60,3 +60,10 @@ class ApplySerializer(serializers.Serializer):
|
|||
raise serializers.ValidationError(_(
|
||||
'Permission named `{}` already exists'.format(permission_name)
|
||||
))
|
||||
|
||||
def validate_apply_date_expired(self, apply_date_expired):
|
||||
apply_date_start = self.root.initial_data['meta'].get('apply_date_start')
|
||||
if str(apply_date_expired) <= apply_date_start:
|
||||
error = _('The expiration date should be greater than the start date')
|
||||
raise serializers.ValidationError(error)
|
||||
return apply_date_expired
|
||||
|
|
Loading…
Reference in New Issue