diff --git a/bookwyrm/forms.py b/bookwyrm/forms.py index 1477234f..855edf1e 100644 --- a/bookwyrm/forms.py +++ b/bookwyrm/forms.py @@ -121,6 +121,20 @@ class StatusForm(CustomForm): fields = ["user", "content", "content_warning", "sensitive", "privacy"] +def get_form_from_status(status): + """ form-ify a status (for delete and redraft) """ + if isinstance(status, models.Review): + return ReviewForm(instance=status) + if isinstance(status, models.Comment): + return CommentForm(instance=status) + if isinstance(status, models.Quotation): + return QuotationForm(instance=status) + if status.reply_parent: + return ReplyForm(instance=status) + else: + return StatusForm(instance=status) + + class EditUserForm(CustomForm): class Meta: model = models.User diff --git a/bookwyrm/templates/snippets/status/status_options.html b/bookwyrm/templates/snippets/status/status_options.html index 6f0ca2e6..7cc74f07 100644 --- a/bookwyrm/templates/snippets/status/status_options.html +++ b/bookwyrm/templates/snippets/status/status_options.html @@ -19,6 +19,14 @@ +