Skip to content

Commit

Permalink
fixup! feat(sdk): upgrade to Pydantic v2
Browse files Browse the repository at this point in the history
  • Loading branch information
IamAbbey committed Jul 18, 2023
1 parent 26492ca commit 16a7d66
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions youtrack_sdk/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,10 @@ class SimpleIssueCustomField(IssueCustomField):
@field_validator("value")
def validate_value(cls, value, info: FieldValidationInfo):
"""We only want to validate further if we are dealing with project custom field with id 'date and time'"""
if (project_custom_field := info.data.get("project_custom_field")) and (
project_custom_field.field.field_type.id == "date and time"
if (
(project_custom_field := info.data.get("project_custom_field"))
and (project_custom_field.field.field_type.id == "date and time")
and value is not None
):
if isinstance(value, datetime):
return value
Expand Down

0 comments on commit 16a7d66

Please sign in to comment.