Skip to content

Commit

Permalink
Overrite perform_destroy repository
Browse files Browse the repository at this point in the history
  • Loading branch information
zMardone committed Apr 17, 2024
1 parent 44e2be8 commit 4d8088e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bothub/api/v2/repository/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,21 @@ def create(self, validated_data):

return repository

def perform_destroy(self, instance):
celery_app.send_task(
"send_recent_activity",
[
{
"user": self.context["request"].user.email,
"entity": "AI",
"action": "DELETE",
"entity_name": instance.name,
"intelligence_id": instance.owner.organization.id,
}
],
)
return super().perform_destroy(instance)

def get_intents(self, obj):
return obj.get_formatted_intents()

Expand Down

0 comments on commit 4d8088e

Please sign in to comment.