Skip to content

Commit

Permalink
Refs #1. Fixed improper management of required version < 0
Browse files Browse the repository at this point in the history
  • Loading branch information
SBriere committed Mar 19, 2024
1 parent f5c8791 commit d7f96a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libDashboards/db/models/DashDashboardProjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def to_json(self, ignore_fields=None, minimal=False, latest=True):
# Get the appropriate dashboard to jsonize
if latest and not minimal:
dashboard_json['versions'] = []
if self.dashboard_project_version:
if self.dashboard_project_version and self.dashboard_project_version > 0:
for version in self.dashboard_project_dashboard.dashboard_versions:
if version.dashboard_version == self.dashboard_project_version:
dashboard_json['versions'] = version.to_json(minimal=True)
Expand Down
2 changes: 1 addition & 1 deletion libDashboards/db/models/DashDashboardSites.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def to_json(self, ignore_fields=None, minimal=False, latest=True):
# Get the appropriate dashboard to jsonize
if latest and not minimal:
dashboard_json['versions'] = []
if self.dashboard_site_version:
if self.dashboard_site_version and self.dashboard_site_version > 0:
for version in self.dashboard_site_dashboard.dashboard_versions:
if version.dashboard_version == self.dashboard_site_version:
dashboard_json['versions'] = version.to_json(minimal=True)
Expand Down

0 comments on commit d7f96a5

Please sign in to comment.