Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds 404 status code handling for requests to missing or invalid sites. When a user tries to access the application with an invalid subdomain (e.g., "random.ureport.io" when no such organization exists), the application now properly returns a 404 status code instead of potentially causing errors or showing unexpected behavior.
Changes:
- Added None check in
RedirectConfigMixin.has_permission()to return False when organization is missing - Added None check in
IndexView.pre_process()to raise Http404 when organization is missing - Added tests to verify 404 responses for both IndexView and views using RedirectConfigMixin
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| ureport/public/views.py | Added org None checks in RedirectConfigMixin and IndexView to properly handle missing organizations |
| ureport/public/tests.py | Added test cases to verify 404 responses for invalid server names |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1333 +/- ##
==========================================
- Coverage 83.72% 83.72% -0.01%
==========================================
Files 49 49
Lines 6017 6021 +4
==========================================
+ Hits 5038 5041 +3
- Misses 979 980 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.