mirror of https://github.com/langgenius/dify.git
refactor(trigger): enhance update method to use explicit None checks
- Updated the `update` method in `SubscriptionBuilderUpdater` to use 'is not None' checks instead of truthy evaluations for better handling of empty values. - This change improves clarity and ensures that empty dictionaries or strings are correctly processed during updates.
This commit is contained in:
parent
755fb96a33
commit
90ae5e5865
|
|
@ -242,19 +242,19 @@ class SubscriptionBuilderUpdater(BaseModel):
|
|||
expires_at: int | None = Field(default=None, description="The expires at of the subscription builder")
|
||||
|
||||
def update(self, subscription_builder: SubscriptionBuilder) -> None:
|
||||
if self.name:
|
||||
if self.name is not None:
|
||||
subscription_builder.name = self.name
|
||||
if self.parameters:
|
||||
if self.parameters is not None:
|
||||
subscription_builder.parameters = self.parameters
|
||||
if self.properties:
|
||||
if self.properties is not None:
|
||||
subscription_builder.properties = self.properties
|
||||
if self.credentials:
|
||||
if self.credentials is not None:
|
||||
subscription_builder.credentials = self.credentials
|
||||
if self.credential_type:
|
||||
if self.credential_type is not None:
|
||||
subscription_builder.credential_type = self.credential_type
|
||||
if self.credential_expires_at:
|
||||
if self.credential_expires_at is not None:
|
||||
subscription_builder.credential_expires_at = self.credential_expires_at
|
||||
if self.expires_at:
|
||||
if self.expires_at is not None:
|
||||
subscription_builder.expires_at = self.expires_at
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue