fix(variables): NoneVariable should inherit from NoneSegment. (#6584)

This commit is contained in:
-LAN- 2024-07-23 21:46:08 +08:00 committed by GitHub
parent 8123a00e97
commit 85a883e281
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 14 deletions

View File

@ -2,17 +2,10 @@ from enum import Enum
class SegmentType(str, Enum):
STRING = 'string'
NUMBER = 'number'
FILE = 'file'
SECRET = 'secret'
OBJECT = 'object'
ARRAY = 'array'
ARRAY_STRING = 'array[string]'
ARRAY_NUMBER = 'array[number]'
ARRAY_OBJECT = 'array[object]'
ARRAY_FILE = 'array[file]'
NONE = 'none'
NUMBER = 'number'
STRING = 'string'
SECRET = 'secret'
ARRAY = 'array'
OBJECT = 'object'
FILE = 'file'

View File

@ -6,7 +6,7 @@ from pydantic import Field
from core.file.file_obj import FileVar
from core.helper import encrypter
from .segments import Segment, StringSegment
from .segments import NoneSegment, Segment, StringSegment
from .types import SegmentType
@ -83,6 +83,6 @@ class SecretVariable(StringVariable):
return encrypter.obfuscated_token(self.value)
class NoneVariable(Variable):
class NoneVariable(NoneSegment, Variable):
value_type: SegmentType = SegmentType.NONE
value: None = None