Skip to content

Show 404 status code for missing sites#1333

Merged
norkans7 merged 2 commits intomainfrom
fix-get-redirect
Feb 18, 2026
Merged

Show 404 status code for missing sites#1333
norkans7 merged 2 commits intomainfrom
fix-get-redirect

Conversation

@norkans7
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings February 18, 2026 09:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-commenter
Copy link

codecov-commenter commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.72%. Comparing base (5dd2674) to head (8427ddf).

Files with missing lines Patch % Lines
ureport/public/views.py 75.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@norkans7 norkans7 merged commit 4dd2dc2 into main Feb 18, 2026
2 checks passed
@norkans7 norkans7 deleted the fix-get-redirect branch February 18, 2026 09:56
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.

3 participants