Fix weird behavior when MULTISITE mode is set to no and the SERVER_NAME is empty

This commit is contained in:
Théophile Diot 2024-01-04 18:06:16 +00:00
parent 7a80516fb3
commit f843cbda5b
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -723,7 +723,7 @@ class Database:
}
)
else:
if not (session.query(Services).with_entities(Services.id).filter_by(id=config.get("SERVER_NAME", "www.example.com").split(" ")[0]).first()):
if config.get("SERVER_NAME", "www.example.com") and not session.query(Services).with_entities(Services.id).filter_by(id=config.get("SERVER_NAME", "www.example.com").split(" ")[0]).first():
to_put.append(Services(id=config.get("SERVER_NAME", "www.example.com").split(" ")[0], method=method))
for key, value in config.items():