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

Fix pk error #806

Merged
merged 4 commits into from
Sep 16, 2021
Merged

Fix pk error #806

merged 4 commits into from
Sep 16, 2021

Conversation

ddusi
Copy link
Contributor

@ddusi ddusi commented Mar 8, 2021

Description

  File "/Users/ddusi/projects/tboard-backend/app/utils/django/models.py", line 226, in post_create_historical_record_callback
    update_change_reason(instance, str(field_diff))
  File "/Users/ddusi/.pyenv/versions/tboard-backend/lib/python3.7/site-packages/simple_history/utils.py", line 14, in update_change_reason
    manager = instance if instance.id is not None else model
AttributeError: 'RegionManagement' object has no attribute 'id'

i found a bug.
I modified the bug to pk that finds the primary key only with id when customizing it.

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

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.

ddusi added 3 commits March 8, 2021 18:12
(cherry picked from commit c4bb9b9)
(cherry picked from commit e308eb6)
@codecov
Copy link

codecov bot commented Mar 8, 2021

Codecov Report

Merging #806 (5b58deb) into master (3b97e7e) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #806   +/-   ##
=======================================
  Coverage   97.68%   97.68%           
=======================================
  Files          19       19           
  Lines         994      994           
  Branches      151      151           
=======================================
  Hits          971      971           
  Misses         10       10           
  Partials       13       13           
Impacted Files Coverage Δ
simple_history/utils.py 100.00% <100.00%> (ø)

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 3b97e7e...5b58deb. Read the comment docs.

jeking3
jeking3 previously approved these changes Aug 24, 2021
@jeking3 jeking3 merged commit 8993c8a into jazzband:master Sep 16, 2021
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.

2 participants