Skip to content

Commit

Permalink
Fix: Improve beta property to handle None and empty report_url
Browse files Browse the repository at this point in the history
  • Loading branch information
mreid-tt committed Jan 20, 2025
1 parent 2b4012b commit 5ea5735
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spkrepo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def version_string(self):

@hybrid_property
def beta(self):
return self.report_url != None # noqa: E711
return bool(self.report_url) # Treats None and "" as False

@hybrid_property
def all_builds_active(self):
Expand All @@ -484,6 +484,10 @@ def all_builds_active(cls):
.label("total_builds")
)

@beta.expression
def beta(cls):
return db.and_(cls.report_url.isnot(None), cls.report_url != "")

@property
def path(self):
return os.path.join(self.package.name, str(self.version))
Expand Down

0 comments on commit 5ea5735

Please sign in to comment.