1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-11-29 22:37:58 +02:00

Unify and coerce booleans from env used in admin

At some places, the string that DOMAIN_REGISTRATION is got used like a boolean
(an easy misassumption to make while in python and dealing with the config
dict), making `DOMAIN_REGISTRATION=False` act as a truthy value. To stop such
future problems from happening, coerce environment config strings to real
bools.

closes #830
This commit is contained in:
Dario Ernst
2019-01-13 10:17:38 +01:00
parent 9175b15d49
commit 66df7a31b0
4 changed files with 14 additions and 5 deletions

View File

@@ -410,7 +410,7 @@ class User(Base, Email):
return emails
def send_welcome(self):
if app.config["WELCOME"].lower() == "true":
if app.config["WELCOME"]:
self.sendmail(app.config["WELCOME_SUBJECT"],
app.config["WELCOME_BODY"])