plugin account: print a warning and use "example.net" as default instead or raising an error when xmpp_domain is not set

This commit is contained in:
Goffi 2017-06-21 19:36:00 +02:00
commit 0b1b687ca3

View file

@ -90,6 +90,8 @@ Salut à Toi association
https://www.salut-a-toi.org
""")
DEFAULT_DOMAIN = u"example.net"
class MiscAccount(object):
"""Account plugin: create a SàT + XMPP account, used by Libervia"""
@ -279,7 +281,8 @@ class MiscAccount(object):
domain = self.getConfig('new_account_domain') or self.getConfig('xmpp_domain', None)
if not domain:
raise ValueError(_(u"xmpp_domain need to be set in sat.conf"))
log.warning(_(u'xmpp_domain needs to be set in sat.conf. Using "{default}" meanwhile').format(default=DEFAULT_DOMAIN))
return DEFAULT_DOMAIN
return domain
def _getAccountDialogUI(self, profile):