fix: o namespace routing refinement

Closes #568839 (closed)

Changes

This MR fixes the bug where usernames starting with o. (like o.redka and o.kosatka) were returning 404 errors instead of displaying user profile pages.

Root Cause

The /o route for organizations index was incorrectly matching usernames like o.redka because Rails was interpreting the period (.) as a format separator, treating /o.redka as the /o route with format: 'redka'.

Solution

1. Fixed route definition in config/routes/organizations.rb:

  • Added format: false constraint to the /o route
  • This prevents Rails from treating periods as format separators
  • Ensures the /o route only matches exactly /o without any suffix

2. Added test coverage:

  • Test to verify /o.json does not route to organizations index
  • Test to verify usernames starting with o. (like o.redka) routes to the user profile

Impact

  • User profiles for usernames starting with o. will now correctly route to user profile pages
  • The /o organizations index route continues to work as expected
Edited by Alex Pooley

Merge request reports

Loading