lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Ensure site can only either be a private instance or federated when creating or editing site

Open scme0 opened this issue 1 year ago • 2 comments

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

scme0 avatar Jun 21 '23 01:06 scme0

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.

Nutomic avatar Jun 21 '23 09:06 Nutomic

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. 👍

scme0 avatar Jun 21 '23 09:06 scme0