From 3fbeaa10d0fd4f201279fcef70c75084c38f65d8 Mon Sep 17 00:00:00 2001 From: andy Date: Sun, 14 Aug 2022 19:32:24 +0100 Subject: [PATCH] allow setting no last.fm username, closes #40 --- music/api/api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/music/api/api.py b/music/api/api.py index 6673e79..889aaa7 100644 --- a/music/api/api.py +++ b/music/api/api.py @@ -194,6 +194,9 @@ def user_route(auth=None, user=None): logger.info(f'updating lastfm username {user.username} -> {request_json["lastfm_username"]}') user.lastfm_username = request_json['lastfm_username'] + if user.lastfm_username is None: + user.lastfm_username = "" + user.update() logger.info(f'updated {user.username}')