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

Ensure that error pages render the correct error page #2228

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

koetsier
Copy link
Contributor

@koetsier koetsier commented Feb 11, 2025

When entering an incorrect route in the admin portal, it returns a 500 error code with a message:

500 Internal Server Error
If you are the administrator of this website, then please read this web application's log file and/or the web server's log file to find out what went wrong. 

This is an incorrect message and should instead be a message saying that the page does not exist with a 404 error code

Link to JIRA card (if applicable):
https://technologyprogramme.atlassian.net/browse/GW-2100

@koetsier
Copy link
Contributor Author

image

@@ -49,6 +49,7 @@ def super_admin?
end

def redirect_user_with_no_organisation
return if current_user.nil?
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be a line liner? (untested)

Suggested change
return if current_user.nil?
return if current_user.nil? || current_user.is_super_admin? && current_organisation.present?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could do, but I'm not sure if it would make the code easier to understand

Copy link
Contributor

Choose a reason for hiding this comment

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

the 2 returns could also be confusing. No worries, all good.

@koetsier koetsier merged commit 1f167d6 into master Feb 24, 2025
1 check passed
@koetsier koetsier deleted the fix_error_page branch February 24, 2025 10:29
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.

2 participants