fixed postgre type mismatch error in mixins.py#746
fixed postgre type mismatch error in mixins.py#746Tosinibikunle wants to merge 5 commits intojazzband:masterfrom
Conversation
2ykwang
left a comment
There was a problem hiding this comment.
Thanks for the PR! @Tosinibikunle
I’m currently a bit busy with work, so I’ll be able to do a full review this weekend.
In the meantime, could you please:
- Confirm whether the mismatch error occurs in
get_for_objects(from the issue description, it seems to be triggered in the “IN query”) - Check if the same issue also happens in
get_for_object - Add a test case that covers this scenario
|
Also add a changelog entry |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #746 +/- ##
==========================================
+ Coverage 95.81% 95.88% +0.06%
==========================================
Files 34 34
Lines 1194 1190 -4
==========================================
- Hits 1144 1141 -3
+ Misses 50 49 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…-fix' of https://github.com/Tosinibikunle/django-auditlog into postgre-type-mismatch-fix
for more information, see https://pre-commit.ci
|
@2ykwang could you review it again? |
|
@2ykwang can you review this PR? probably we can include this PR in the next release. |
auditlog/models.py
Outdated
| :param queryset: The queryset to get the log entries for. | ||
| :type queryset: QuerySet | ||
| :return: The LogEntry objects for the objects in the given queryset. | ||
| :rtype: QuerySet """ |
There was a problem hiding this comment.
| :rtype: QuerySet """ | |
| :rtype: QuerySet | |
| """ |
| ct = ContentType.objects.get_for_model(obj.__class__) | ||
| log_entries = ( | ||
| LogEntry.objects.get_for_object(obj) | ||
| LogEntry.objects.filter( |
There was a problem hiding this comment.
It would be better to call get_for_object instead of filter.
because it looks the same as the logic in this line.
resolves #740