1
0
Fork 0

Check permissions automatically on form save

This commit is contained in:
Mouse Reeve 2022-08-05 09:51:55 -07:00
parent 2894aa37a2
commit 8f79b362f8
10 changed files with 19 additions and 23 deletions

View file

@ -65,7 +65,6 @@ class CreateStatus(View):
existing_status = get_object_or_404(
models.Status.objects.select_subclasses(), id=existing_status_id
)
existing_status.raise_not_editable(request.user)
existing_status.edited_date = timezone.now()
status_type = status_type[0].upper() + status_type[1:]
@ -84,8 +83,7 @@ class CreateStatus(View):
return HttpResponseBadRequest()
return redirect("/")
status = form.save(commit=False)
status.raise_not_editable(request.user)
status = form.save(request)
# save the plain, unformatted version of the status for future editing
status.raw_content = status.content
if hasattr(status, "quote"):