From 4f1283ff52cbf7cc37f6a66e8331e9eea9711ffe Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 14 Jul 2022 11:42:59 -0700 Subject: [PATCH] Check editability before creating shelf --- bookwyrm/views/shelf/shelf_actions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bookwyrm/views/shelf/shelf_actions.py b/bookwyrm/views/shelf/shelf_actions.py index 5e7e6c0c9..003d8b3b7 100644 --- a/bookwyrm/views/shelf/shelf_actions.py +++ b/bookwyrm/views/shelf/shelf_actions.py @@ -15,7 +15,9 @@ def create_shelf(request): if not form.is_valid(): return redirect(request.headers.get("Referer", "/")) - shelf = form.save() + shelf = form.save(commit=False) + shelf.raise_not_editable(request.user) + shelf.save() return redirect(shelf.local_path)