Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rostisluvvv opened this issue Dec 21, 2023 · 0 comments
Open

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

rostisluvvv opened this issue Dec 21, 2023 · 0 comments

Comments

@rostisluvvv
Copy link

rostisluvvv commented Dec 21, 2023

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/'), ...}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant