[tasks] Scale task sets title properly
All checks were successful
build / test (push) Successful in 1m57s

This commit is contained in:
2026-06-03 16:49:11 -04:00
parent 22319c807a
commit 415b32bdc7
2 changed files with 7 additions and 2 deletions

View File

@ -85,6 +85,11 @@ def import_scale_csv(file_path, user_id):
log_dict["unit_type"] = user.profile.weigh_in_units
weight_val = log_dict.get("weight")
if weight_val is not None:
unit = "kg" if user.profile.weigh_in_units == "metric" else "lbs"
log_dict["title"] = f"{weight_val} {unit}"
existing = Scrobble.objects.filter(
timestamp=start,
task=weigh_in,