mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-23 07:28:08 +00:00
Check editability before creating shelf
This commit is contained in:
parent
05716c3578
commit
4f1283ff52
1 changed files with 3 additions and 1 deletions
|
@ -15,7 +15,9 @@ def create_shelf(request):
|
||||||
if not form.is_valid():
|
if not form.is_valid():
|
||||||
return redirect(request.headers.get("Referer", "/"))
|
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)
|
return redirect(shelf.local_path)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue