Bug #20340
closedUpdating puppet environment which is not associated with organization creates internal server error
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1471702
Description of problem: We were trying to update the puppet environment in particular organization. But when we attempt to update environment which is not associated with organization, it redirects to error page and shows error as
"something went wrong Validation failed: Name has already been taken"
and /var/log/foreman/production.log shows
"500 Internal Server Error"
Version-Release number of selected component (if applicable): sat 6.3 / Foreman nightly
How reproducible: always
Steps to Reproduce:
1. Create an organization
2. Navigate to Configure -> Environments
3. Click on import environment
4. Try to update environment which is not associated with particular organization
Actual results:
It will redirect to error page showing
"something went wrong Validation failed: Name has already been taken"
and produces
"500 Internal Server Error"
in log file.
Expected results:
Error should be handled without navigating to error page and without 500 internal server error.
Additional info:
I suppose we should handle errors more gracefully or maybe even not allowing to display envs that are out of scope for current user.