Skip to content

Commit e537941

Browse files
style: address sonarcube l523 comment
1 parent e58ba8b commit e537941

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/dve/metadata_parser/domain_types.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,8 @@ def validate(cls, value: Union[dt.time, dt.datetime, str]) -> dt.time | None:
519519
raise ValueError("Provided time has timezone, but this is forbidden for this field")
520520
if cls.TIMEZONE_TREATMENT == "require" and not new_time.tzinfo:
521521
raise ValueError("Provided time missing timezone, but this is required for this field")
522-
if isinstance(value, str) and cls.TIME_FORMAT:
523-
if value != str(new_time):
524-
raise ValueError("Provided time is not matching expected time format supplied.")
522+
if isinstance(value, str) and cls.TIME_FORMAT and value != str(new_time):
523+
raise ValueError("Provided time is not matching expected time format supplied.")
525524
return new_time
526525

527526
@classmethod

0 commit comments

Comments
 (0)