Skip to content

Commit

Permalink
returns unsuccessful delete message if neither graphid nor resourceid…
Browse files Browse the repository at this point in the history
…s provided to bulk delete_resources, re #10781
  • Loading branch information
whatisgalen committed May 2, 2024
1 parent 4df4638 commit 1b3e6ac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arches/app/etl_modules/bulk_data_deletion.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ def delete_resources(self, userid, loadid, graphid=None, resourceids=None, verbo
resources = Resource.objects.filter(graph_id=graphid)
elif resourceids:
resources = Resource.objects.filter(pk__in=resourceids)
else:
result["message"] = _("Unable to bulk delete resources as no graphid or resourceids specified.")
result["deleted_count"] = 0
return result

deleted_count = resources.count()

Expand Down

0 comments on commit 1b3e6ac

Please sign in to comment.