-
Notifications
You must be signed in to change notification settings - Fork 4
fix: Check for toolbar attribute before setting preview mode on ?preview=1 request
#71
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
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR adds a safeguard to the preview mode setter by checking for the existence of the request.toolbar attribute before setting preview_mode_active, preventing errors on requests without a toolbar. Class diagram for updated preview mode setter in views_base.pyclassDiagram
class Request {
toolbar
}
class Toolbar {
preview_mode_active
}
Request --> Toolbar : has
class ViewsBase {
_preview_requested()
_preview_requested() checks for toolbar before setting preview_mode_active
}
ViewsBase --> Request : uses
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #71 +/- ##
==========================================
- Coverage 91.78% 90.81% -0.98%
==========================================
Files 18 18
Lines 828 849 +21
Branches 89 98 +9
==========================================
+ Hits 760 771 +11
- Misses 42 48 +6
- Partials 26 30 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@fsbraun: This is not breaking Swagger, nice; I can reach http://localhost:8080/api/docs/. But preview is not working compared to pages. Is it cached? pages correctly fetches preview: |
|
@metaforx I assume in your example you have added a This did not happen when I tested now, but then again, I had made some changes to the code:
|
Bug Fixes:
@metaforx This should now be safe for "non-CMS" api endpoints. Could you check?