Check permissions automatically on form save
This commit is contained in:
parent
2894aa37a2
commit
8f79b362f8
10 changed files with 19 additions and 23 deletions
|
@ -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"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue