django-requestlogs icon indicating copy to clipboard operation
django-requestlogs copied to clipboard

How to use django-requestlogs with drf @actions???

Open rostisluvvv opened this issue 2 years ago • 1 comments

I have ViewSet with drf @action


class SomeView(BaseViewSet):
    requestlogs_action_names = {
        'list': "Receiving",
        "some_action": "some event has occurred",
    }
    ...

    @action(
        methods=["get"],
        detail=True,
        url_path="some-action",
        url_name="some-action",
    )
    def some_action(self, request, *args, **kwargs):
        some_logic(kwargs)
        return response


I can't get action_name to log

Its my log:

{'action_name': None, ... , ('full_path', '/api/some-action/'), ...}

rostisluvvv avatar Dec 21 '23 15:12 rostisluvvv