don't return empty user-values, but return default instead
since otherwise it contradicts the documentation when e.g. sending mail notifications, as the code that requests e.g. the fax.email property provides the user as default. But when using the empty string as documented to use the user's name as sender, it returns the empty string and that then causes sending the mail to fail, as there is no recipient.
This commit is contained in:
parent
4775a92ad3
commit
375d5cda09
|
@ -93,13 +93,15 @@ class CSConfigParser(ConfigParser):
|
|||
Returns the value for this option or None if it's not found
|
||||
"""
|
||||
if self.has_option(user, option):
|
||||
return self.get(user, option)
|
||||
retval = self.get(user, option)
|
||||
elif self.has_option('GLOBAL', option):
|
||||
return self.get('GLOBAL', option)
|
||||
retval = self.get('GLOBAL', option)
|
||||
elif fail:
|
||||
raise NoOptionError(user, option)
|
||||
else:
|
||||
return default
|
||||
# don't return empty values
|
||||
if retval:
|
||||
return retval
|
||||
return default
|
||||
|
||||
def listUsers(self):
|
||||
ul = [ u
|
||||
|
|
Loading…
Reference in New Issue