Skip to content

Commit

Permalink
fix: an error when current build_date is None
Browse files Browse the repository at this point in the history
  • Loading branch information
newgene committed Jul 3, 2023
1 parent 20a38d4 commit 3141e5e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions biothings/web/services/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,8 @@ def __add__(self, other):
# take the latest build_date
# TODO if one of them is None
build_date = self.build_date
if other.build_date and other.build_date > self.build_date:
if other.build_date and (not build_date or other.build_date > build_date):
# set to other.build_data if it's newer or current build_date is None
build_date = other.build_date

# combine build_version field
Expand All @@ -454,7 +455,7 @@ def __add__(self, other):

return BiothingHubMeta(
biothing_type=biothing_type,
build_date=build_date.isoformat(),
build_date=build_date.isoformat() if build_date else None,
build_version=build_version,
src=src,
stats=stats,
Expand Down

0 comments on commit 3141e5e

Please sign in to comment.