-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix missing query-actions buttons for queries with date/datetime params. #1019
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
Conversation
Apparently I'm a bit too optimistic on the support of those date/time lookups in django, let me fix that. |
Codecov Report
@@ Coverage Diff @@
## master #1019 +/- ##
==========================================
- Coverage 84.65% 84.33% -0.32%
==========================================
Files 25 24 -1
Lines 1323 1296 -27
Branches 182 176 -6
==========================================
- Hits 1120 1093 -27
Misses 155 155
Partials 48 48
Continue to review full report at Codecov.
|
I changed the test so it passed on all test environments. Unfortunately, this means I cannot test |
The param `strings_only=True` caused params with type `time`, `date` and `datetime` to not be converted to string by `NormalCursorWrapper._decode()`, and in turn causes the json dumping to fail. This change keeps `strings_only=True` for every type but datetime, date and time, enabling conversion to string in those cases. Fixes django-commons#882
debug_toolbar/panels/sql/tracking.py
Outdated
@@ -114,7 +117,7 @@ def _record(self, method, sql, params): | |||
_params = '' | |||
try: | |||
_params = json.dumps([self._decode(p) for p in params]) | |||
except Exception: | |||
except TypeError as e: |
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.
I'm a bit surprised that this pull request passes the build, since this is an unused variable right here.
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.
Strange indeed. Just pushed a commit removing the variable.
@matthiask ran into this bug again today, it would be nice to have this into a released version. Is there a plan to do a new release? |
Thanks for the reminder. It's on a long list of things I want to do. I'll hopefully get around to it in the next few days. |
@matthiask I'm a bit hesitant to bug you again, but can I do anything to help to get this released? (ran into another query with date-params I wanted to debug... |
Posting here because it took such a long time to do this: 1.10.1 has been released this week. |
Yes, I noticed. Thanks! |
The param
strings_only=True
caused params with typetime
,date
anddatetime
to not be converted to string byNormalCursorWrapper._decode()
,and in turn causes the json dumping to fail.
This change keeps
strings_only=True
for every type but datetime, date andtime, enabling conversion to string in those cases.
Fixes #882