lemmy
lemmy copied to clipboard
Ensure site can only either be a private instance or federated when creating or editing site
On start-up Lemmy checks if both the private_instance
and federation_enabled
flags are set. If they are, it raises and error which stops start-up meaning administrators are unable to edit the settings which cause the error.
As a means of prevention, I've added some validation when editing or creating a site to ensure that both options are never selected at the same time.
I thought about adjusting start-up behaviour to disregard one of the flags (like ignore federation if the private flag is set) but I thought it would be easier to just prevent the invalid state from being saved.
This could probably coincide with a change to the UI as well but I can do that after.
Solves #3138
This was already implemented in https://github.com/LemmyNet/lemmy/pull/3074. Though admittedly your code is much cleaner, I would merge it if you remove the existing check and reuse the same translation string.
Ah sorry, I didn't spot that the new issue was a dupe. No problems I've updated it. Let me know if there is anything else I need to do. 👍