Removes explicit calls to raise_not_editable from views

These raises are handled implicitly in the form, so they don't have to
be called outright.
This commit is contained in:
Mouse Reeve 2022-09-08 11:03:06 -07:00
parent 351292fcda
commit 543d13af6e
4 changed files with 0 additions and 5 deletions

View file

@ -82,7 +82,6 @@ class GetStartedBooks(View):
for (book_id, shelf_id) in shelve_actions: for (book_id, shelf_id) in shelve_actions:
book = get_object_or_404(models.Edition, id=book_id) book = get_object_or_404(models.Edition, id=book_id)
shelf = get_object_or_404(models.Shelf, id=shelf_id) shelf = get_object_or_404(models.Shelf, id=shelf_id)
shelf.raise_not_editable(request.user)
models.ShelfBook.objects.create(book=book, shelf=shelf, user=request.user) models.ShelfBook.objects.create(book=book, shelf=shelf, user=request.user)
return redirect(self.next_view) return redirect(self.next_view)

View file

@ -31,7 +31,6 @@ class Curate(View):
def post(self, request, list_id): def post(self, request, list_id):
"""edit a book_list""" """edit a book_list"""
book_list = get_object_or_404(models.List, id=list_id) book_list = get_object_or_404(models.List, id=list_id)
book_list.raise_not_editable(request.user)
suggestion = get_object_or_404(models.ListItem, id=request.POST.get("item")) suggestion = get_object_or_404(models.ListItem, id=request.POST.get("item"))
approved = request.POST.get("approved") == "true" approved = request.POST.get("approved") == "true"

View file

@ -241,7 +241,6 @@ def set_book_position(request, list_item_id):
special care with the unique ordering per list. special care with the unique ordering per list.
""" """
list_item = get_object_or_404(models.ListItem, id=list_item_id) list_item = get_object_or_404(models.ListItem, id=list_item_id)
list_item.book_list.raise_not_editable(request.user)
try: try:
int_position = int(request.POST.get("position")) int_position = int(request.POST.get("position"))
except ValueError: except ValueError:

View file

@ -34,7 +34,6 @@ class EditStatus(View):
status = get_object_or_404( status = get_object_or_404(
models.Status.objects.select_subclasses(), id=status_id models.Status.objects.select_subclasses(), id=status_id
) )
status.raise_not_editable(request.user)
status_type = "reply" if status.reply_parent else status.status_type.lower() status_type = "reply" if status.reply_parent else status.status_type.lower()
data = { data = {
@ -163,7 +162,6 @@ def edit_readthrough(request):
"""can't use the form because the dates are too finnicky""" """can't use the form because the dates are too finnicky"""
# TODO: remove this, it duplicates the code in the ReadThrough view # TODO: remove this, it duplicates the code in the ReadThrough view
readthrough = get_object_or_404(models.ReadThrough, id=request.POST.get("id")) readthrough = get_object_or_404(models.ReadThrough, id=request.POST.get("id"))
readthrough.raise_not_editable(request.user)
readthrough.start_date = load_date_in_user_tz_as_utc( readthrough.start_date = load_date_in_user_tz_as_utc(
request.POST.get("start_date"), request.user request.POST.get("start_date"), request.user