From 635e8053cd3626b9e7eb4b67d1e632388a4c334a Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Sun, 26 Nov 2023 21:36:45 +0100 Subject: [PATCH] Fix bug in notes for geo scrobbles --- vrobbler/apps/scrobbles/scrobblers.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vrobbler/apps/scrobbles/scrobblers.py b/vrobbler/apps/scrobbles/scrobblers.py index 4b120ff..81515d6 100644 --- a/vrobbler/apps/scrobbles/scrobblers.py +++ b/vrobbler/apps/scrobbles/scrobblers.py @@ -268,10 +268,11 @@ def gpslogger_scrobble_location( scrobble = Scrobble.create_or_update(location, user_id, extra_data) provider = f"data source: {LOCATION_PROVIDERS[data_dict.get('prov')]}" - if scrobble.notes: - scrobble.notes = scrobble.notes + f"\n{provider}" - else: - scrobble.notes = provider - scrobble.save(update_fields=["notes"]) + if scrobble: + if scrobble.notes: + scrobble.notes = scrobble.notes + f"\n{provider}" + else: + scrobble.notes = provider + scrobble.save(update_fields=["notes"]) return scrobble