Adds model-to-form helper for statuses

This commit is contained in:
Mouse Reeve
2021-04-03 14:55:13 -07:00
parent 4cf9bca5aa
commit 2a4fc8fb9a
3 changed files with 24 additions and 2 deletions

View File

@ -107,8 +107,8 @@ class DeleteAndRedraft(View):
if status.user != request.user and not request.user.has_perm("moderate_post"):
return HttpResponseBadRequest()
# TODO: get the correct form (maybe a generic form)
data = {"form": forms.StatusForm(instance=status)}
data = {"form": forms.get_form_from_status(status)}
if hasattr(status, "book"):
data["book"] = status.book