[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

@ -93,7 +93,7 @@ fetching and simple saving.
:LOGBOOK: :LOGBOOK:
CLOCK: [2025-07-09 Wed 09:55]--[2025-07-09 Wed 10:15] => 0:20 CLOCK: [2025-07-09 Wed 09:55]--[2025-07-09 Wed 10:15] => 0:20
:END: :END:
* Backlog [0/15] :vrobbler:project:personal: * Backlog [1/15] :vrobbler:project:personal:
** TODO [#C] Add sentiment parsing for Scrobbles with notes :vrobbler:project:scrobbles:sentiment: ** TODO [#C] Add sentiment parsing for Scrobbles with notes :vrobbler:project:scrobbles:sentiment:
:PROPERTIES: :PROPERTIES:
:ID: 37781d6a-f3b0-48b2-bf98-33c2c791cf85 :ID: 37781d6a-f3b0-48b2-bf98-33c2c791cf85
@ -505,7 +505,7 @@ different. And the same for comments. If a comment (by timestamp key) is
different in the webhook than what's in the scrobble.log, update the comment in different in the webhook than what's in the scrobble.log, update the comment in
the scrobble.log the scrobble.log
** TODO [#C] Fix bug where Weigh-in imports do not set title :bug:tasks:scale: ** DONE [#C] Fix bug where Weigh-in imports do not set title :bug:tasks:scale:
:PROPERTIES: :PROPERTIES:
:ID: 622e354a-8e66-4ecd-9e1c-a53f0a2ec362 :ID: 622e354a-8e66-4ecd-9e1c-a53f0a2ec362
:END: :END:

View File

@ -85,6 +85,11 @@ def import_scale_csv(file_path, user_id):
log_dict["unit_type"] = user.profile.weigh_in_units 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( existing = Scrobble.objects.filter(
timestamp=start, timestamp=start,
task=weigh_in, task=weigh_in,