Check editability before creating shelf

This commit is contained in:
Mouse Reeve 2022-07-14 11:42:59 -07:00
parent 05716c3578
commit 4f1283ff52

View file

@ -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)