Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ Section Order:

<!-- Your changes go here -->

### Changed

- Show ADM with always 1 decimal

## [5.1.0] - 2026-08-04

> [!IMPORTANT]
Expand Down
2 changes: 1 addition & 1 deletion sovtimer/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def test_dashboard_data_handles_missing_vulnerability_levels(

self.assertEqual(response.status_code, HTTPStatus.OK)
self.assertEqual(len(response.json()), 1)
self.assertEqual(response.json()[0]["adm"], 1)
self.assertEqual(response.json()[0]["adm"], "1.0")

@patch("sovtimer.views.Campaign.Type")
@patch("sovtimer.views.timezone.now")
Expand Down
6 changes: 4 additions & 2 deletions sovtimer/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ def dashboard_data( # pylint: disable=too-many-statements too-many-locals
region_name = region.name
region_name_html = f'<a href="{region_url}" target="_blank" rel="noopener noreferer">{region_name}</a>'

# Activity defense multiplier (fast lookup)
structure_adm = occupancy_by_system.get(campaign.structure.solar_system_id, 1)
# Activity defense multiplier (fast lookup) formatted with one decimal
structure_adm = (
f"{occupancy_by_system.get(campaign.structure.solar_system_id, 1):.1f}"
)

# Start time and remaining seconds (use timezone-aware now)
start_time = campaign.start_time
Expand Down
Loading