Skip to content

Commit

Permalink
fix update_change_reason Func for PrimaryKey
Browse files Browse the repository at this point in the history
  • Loading branch information
ddusi committed Mar 8, 2021
1 parent 0de0649 commit 8b62504
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion simple_history/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def update_change_reason(instance, reason):
attrs = {}
model = type(instance)
manager = instance if instance.id is not None else model
manager = instance if instance.pk is not None else model
history = get_history_manager_for_model(manager)
history_fields = [field.attname for field in history.model._meta.fields]
for field in instance._meta.fields:
Expand Down

0 comments on commit 8b62504

Please sign in to comment.