diff --git a/onadata/apps/logger/admin.py b/onadata/apps/logger/admin.py index 085e0f63e7..33b80d04cf 100644 --- a/onadata/apps/logger/admin.py +++ b/onadata/apps/logger/admin.py @@ -76,6 +76,15 @@ def delete_queryset(self, request, queryset): level=messages.SUCCESS, ) + def delete_model(self, request, obj): + """ + Override delete_model to perform soft deletion on a single XForm. + """ + obj.soft_delete(user=request.user) + self.message_user( + request, _("The XForm has been soft-deleted."), level=messages.SUCCESS + ) + admin.site.register(XForm, XFormAdmin)