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

User object not recorded #241

Open
steverecio opened this issue Dec 2, 2022 · 2 comments · May be fixed by #242
Open

User object not recorded #241

steverecio opened this issue Dec 2, 2022 · 2 comments · May be fixed by #242

Comments

@steverecio
Copy link
Contributor

steverecio commented Dec 2, 2022

I noticed that the User object was not being recorded for request events. Is anyone else running into this? Previously it seemed to be isolated to requests using token authentication (knox-rest-auth) now I'm seeing it for django-allauth authentication schemes as well (running v1.3.3)

@steverecio
Copy link
Contributor Author

steverecio commented Dec 2, 2022

Looks to be related to this bit of code: https://github.com/soynatan/django-easy-audit/blob/master/easyaudit/signals/request_signals.py#L61

What is the rationale for getting the user from the session cookie instead of request.user?

@steverecio steverecio linked a pull request Dec 2, 2022 that will close this issue
@mschoettle
Copy link
Contributor

What is the rationale for getting the user from the session cookie instead of request.user?

I think it's because the request is unavailable in the signal handling. See #225.

I agree that easy audit should use request.user instead of re-parsing the cookie. Django already handles this (in one of the middlewares I believe). There is also a related discussion in #165.

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

Successfully merging a pull request may close this issue.

2 participants