Skip to content

Commit

Permalink
soft-delete XForm deleted from the admin detail page
Browse files Browse the repository at this point in the history
soft-delete XForm deleted from the admin detail page using the Delete button
  • Loading branch information
kelvin-muchiri committed Nov 27, 2024
1 parent 85857ad commit 02be232
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions onadata/apps/logger/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 02be232

Please sign in to comment.