-
Notifications
You must be signed in to change notification settings - Fork 437
fixed postgre type mismatch error in mixins.py #746
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
base: master
Are you sure you want to change the base?
fixed postgre type mismatch error in mixins.py #746
Conversation
2ykwang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| :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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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