Skip to content
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

fix: Fix debug toolbar upgrade issue #600

Merged
merged 1 commit into from
Jul 24, 2024
Merged

fix: Fix debug toolbar upgrade issue #600

merged 1 commit into from
Jul 24, 2024

Conversation

bellini666
Copy link
Member

@bellini666 bellini666 commented Jul 24, 2024

_HTML_TYPES got moved to somewhere else.

Instead of trying to import from both places, just copy it. It is a small list that should not suffer from changes often, and also prevents us from having to import a private member from the module.

Fix #586

@bellini666 bellini666 self-assigned this Jul 24, 2024
Copy link
Contributor

sourcery-ai bot commented Jul 24, 2024

Reviewer's Guide by Sourcery

This pull request addresses issue #1963 by replacing the usage of the private member _HTML_TYPES with a hardcoded set of HTML content types in the strawberry_django/middlewares/debug_toolbar.py file. This change prevents the need to import a private member from the module, simplifying the code and reducing dependency on the module's internal implementation.

File-Level Changes

Files Changes
strawberry_django/middlewares/debug_toolbar.py Replaced the usage of a private member _HTML_TYPES with a hardcoded set of HTML content types to avoid importing a private member from the module.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bellini666 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding a brief comment explaining why these MIME types are hardcoded here instead of imported. This will help future maintainers understand the rationale behind this approach.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

strawberry_django/middlewares/debug_toolbar.py Outdated Show resolved Hide resolved
`_HTML_TYPES` got moved to somewhere else.

Instead of trying to import from both places, just copy it. It is
a small list that should not suffer from changes often, and also
prevents us from having to import a private member from the module.

Fix #586
@bellini666 bellini666 merged commit 6dc6be9 into main Jul 24, 2024
22 checks passed
@bellini666 bellini666 deleted the fix_debug_toolbar branch July 24, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Strawberry breaks django debug toolbar
1 participant