summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDashie <dashie@sigpipe.me>2019-12-21 12:16:35 +0100
committerDashie <dashie@sigpipe.me>2019-12-21 12:16:35 +0100
commit1ba9dd46dd0a3188c03e4d2de964f05da8101037 (patch)
tree2431a3a168e0575dc65fc1eac861215a0f8a0caf
parent638531573a81452973432dfba8bf6f48c91a9b9b (diff)
This should be like that...
-rw-r--r--api/controllers/api/albums.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/api/controllers/api/albums.py b/api/controllers/api/albums.py
index 699baf4e..d9b472dd 100644
--- a/api/controllers/api/albums.py
+++ b/api/controllers/api/albums.py
@@ -51,6 +51,7 @@ def new():
form = AlbumForm()
if form.validate_on_submit():
+ print(f"album private: {form.private.data!r}")
rec = Album()
rec.user_id = current_user.id
rec.title = form.title.data
@@ -239,8 +240,10 @@ def edit(username, albumslug):
genre = request.json.get("genre")
tags = request.json.get("tags")
- if album.private and not private:
- return jsonify({"error": "Cannot change to private: album already federated"})
+ print(f"Album privacy: {album.private!r}, want: {private!r}")
+
+ if not album.private and private:
+ return jsonify({"error": "Cannot change to private: album already federated"}), 400
if not title:
return jsonify({"error": "Album title is required"}), 400