# HG changeset patch
# User Goffi <goffi@goffi.org>
# Date 1498066560 -7200
# Node ID 8be4f5769bf7b22f150dda835985762af2fa6206
# Parent  45b89d7c5c8139dbf3949cdc2d47bd01b5feeb47
plugin account: print a warning and use "example.net" as default instead or raising an error when xmpp_domain is not set

diff -r 45b89d7c5c81 -r 8be4f5769bf7 src/plugins/plugin_misc_account.py
--- a/src/plugins/plugin_misc_account.py	Wed Jun 21 08:00:14 2017 +0200
+++ b/src/plugins/plugin_misc_account.py	Wed Jun 21 19:36:00 2017 +0200
@@ -90,6 +90,8 @@
 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 @@
 
         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):