Fix deletion of public api tokens (#422)

This commit is contained in:
Innokentii Konstantinov 2022-08-30 18:25:19 +05:00 committed by GitHub
parent ddedf88632
commit 45a2d46405
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,7 @@ class PublicApiTokenView(
def destroy(self, request, *args, **kwargs):
instance = self.get_object()
write_resource_insight_log(instance=instance, author=instance.author, event=EntityEvent.DELETED)
write_resource_insight_log(instance=instance, author=request.user, event=EntityEvent.DELETED)
self.perform_destroy(instance)
return Response(status=status.HTTP_204_NO_CONTENT)