Skip to content

Commit

Permalink
Refs #1668: Fixed the unsortable session keys fallback (#1994)
Browse files Browse the repository at this point in the history
* Refs #1668: Fixed the unsortable session keys fallback
* Disable the flake8-simplify ruleset
  • Loading branch information
matthiask authored Aug 21, 2024
1 parent 6fc5ce8 commit 3ef6e69
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion debug_toolbar/panels/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,8 @@ def generate_stats(self, request, response):
(k, request.session.get(k)) for k in sorted(request.session.keys())
]
except TypeError:
session_list = [(k, request.session.get(k)) for k in request.session]
session_list = [
(k, request.session.get(k))
for k in request.session.keys() # (it's not a dict)
]
self.record_stats({"session": {"list": session_list}})
2 changes: 2 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Pending
* Add translations for Bulgarian and Korean.
* Update translations for several languages.
* Include new translatable strings for translation.
* Fixed a crash which happened in the fallback case when session keys cannot be
sorted.

4.4.6 (2024-07-10)
------------------
Expand Down
8 changes: 3 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,14 @@ lint.extend-select = [
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"RUF100", # Unused noqa directive
"SIM", # flake8-simplify
"SLOT", # flake8-slots
"UP", # pyupgrade
"W", # pycodestyle warnings
]
lint.extend-ignore = [
"B905", # Allow zip() without strict=
"E501", # Ignore line length violations
"SIM108", # Use ternary operator instead of if-else-block
"UP031", # It's not always wrong to use percent-formatting
"B905", # Allow zip() without strict=
"E501", # Ignore line length violations
"UP031", # It's not always wrong to use percent-formatting
]
lint.per-file-ignores."*/migrat*/*" = [
"N806", # Allow using PascalCase model names in migrations
Expand Down

0 comments on commit 3ef6e69

Please sign in to comment.