[#645] Fix impossible to edit the server_name of an already existing service if the primary one was unchanged in web UI

This commit is contained in:
Théophile Diot 2023-10-19 12:38:19 +02:00
parent 60d43d0ce0
commit 7e3aad9f09
No known key found for this signature in database
GPG Key ID: 248FEA4BAE400D06
1 changed files with 1 additions and 1 deletions

View File

@ -218,7 +218,7 @@ class Config:
old_server_name_splitted = old_server_name.split(" ")
for i, service in enumerate(deepcopy(services)):
if service["SERVER_NAME"] == variables["SERVER_NAME"] or service["SERVER_NAME"] in server_name_splitted:
if changed_server_name:
if changed_server_name and service["SERVER_NAME"].split(" ")[0] != old_server_name_splitted[0]:
return (
f"Service {service['SERVER_NAME'].split(' ')[0]} already exists.",
1,