Disallow deletion of Environment when hosts are using it
The current Environment implementation in Foreman allows you to delete an Environment even if there are Hosts using it.
When you delete it, the Hosts are left with no puppet Environment.
There could be potential issues with this. (There could be different modules or templates in the default Environment)
It would be better if Foreman at least warned that some Hosts are using the Env.
Ideally, the Admin should reassign the Env to a different one before deleting it.
Foreman could also mention that.