Skip to content

Get default user for bulk ops from middleware #677

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

Merged
merged 6 commits into from
Jun 20, 2020

Conversation

rossmechanic
Copy link

@rossmechanic rossmechanic commented Jun 19, 2020

Description

Bulk utility operations such as bulk_create_with_history and bulk_update_with_history were recently added to the library. Both functions allow you to specify a default user, or to specify the user on the object instances themselves using _history_user. However, there's no easy way to get the current user in the same way that we get it for normal historical model creation. This PR updates those bulk create operations such that the user is the same user that would be applied if they were not bulk operations (unless you specify

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have run the make format command to format my code
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have added my name and/or github handle to AUTHORS.rst
  • I have added my change to CHANGES.rst
  • All new and existing tests passed.

Sorry, something went wrong.

@codecov
Copy link

codecov bot commented Jun 19, 2020

Codecov Report

Merging #677 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #677   +/-   ##
=======================================
  Coverage   97.23%   97.24%           
=======================================
  Files          18       18           
  Lines         977      980    +3     
  Branches      147      147           
=======================================
+ Hits          950      953    +3     
  Misses         13       13           
  Partials       14       14           
Impacted Files Coverage Δ
simple_history/manager.py 97.36% <100.00%> (+0.03%) ⬆️
simple_history/models.py 98.46% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66cb8e4...fe2700b. Read the comment docs.

@rossmechanic rossmechanic force-pushed the get-default-user-for-bulk-ops-from-middleware branch from dab8b4e to d241c52 Compare June 19, 2020 19:26
@rossmechanic rossmechanic marked this pull request as ready for review June 19, 2020 19:40
@rossmechanic rossmechanic force-pushed the get-default-user-for-bulk-ops-from-middleware branch from f0c6ff5 to fe2700b Compare June 20, 2020 14:35
@rossmechanic rossmechanic merged commit cfc223b into master Jun 20, 2020
@rossmechanic rossmechanic deleted the get-default-user-for-bulk-ops-from-middleware branch June 20, 2020 14:51
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.

None yet

2 participants