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

Always call set_actor #484

Merged
merged 2 commits into from
Jan 4, 2023
Merged

Conversation

aqeelat
Copy link
Member

@aqeelat aqeelat commented Dec 22, 2022

My take on #279

@codecov
Copy link

codecov bot commented Dec 22, 2022

Codecov Report

Merging #484 (9c7b732) into master (7f8edd5) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #484      +/-   ##
==========================================
+ Coverage   94.11%   94.16%   +0.04%     
==========================================
  Files          30       30              
  Lines         884      891       +7     
==========================================
+ Hits          832      839       +7     
  Misses         52       52              
Impacted Files Coverage Δ
auditlog/context.py 82.05% <100.00%> (-0.88%) ⬇️
auditlog/middleware.py 100.00% <100.00%> (ø)
auditlog/registry.py 98.60% <0.00%> (+0.02%) ⬆️
auditlog/diff.py 97.29% <0.00%> (+0.07%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@aqeelat aqeelat changed the title fix: called set_actor even when is the user is anon Always call set_actor Dec 22, 2022
@aqeelat aqeelat linked an issue Dec 22, 2022 that may be closed by this pull request
@aqeelat
Copy link
Member Author

aqeelat commented Dec 22, 2022

@hramezani I guess a better way to do it is to create a function called get_metadata that gets called in LogEntry.objects.log_create. This function gets actor, cid, and remote_addr. This way, we wouldn't need a context manager or a pre_save signal.

But that should be in a separate issue/PR where we discuss the new structure.

@aqeelat aqeelat self-assigned this Dec 22, 2022
@hramezani
Copy link
Member

@aqeelat Thanks for this patch 👍
Could you please refresh this patch?

@hramezani
Copy link
Member

@aqeelat Could you please fix the failing tests?

@hramezani hramezani merged commit f6b9e9f into jazzband:master Jan 4, 2023
@aqeelat aqeelat deleted the always_call_set_actor branch January 5, 2023 11:16
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 this pull request may close these issues.

Remote Address not set if user not authenticated
2 participants