diff sat.tac @ 23:925ab466c5ec

better presentation for register new account - error message when no user, pass or server given - server is now automatically updated when jid change in connection category
author Goffi <goffi@goffi.org>
date Tue, 01 Dec 2009 06:07:20 +0100
parents bb72c29f3432
children 53e921c8a357
line wrap: on
line diff
--- a/sat.tac	Tue Dec 01 04:56:08 2009 +0100
+++ b/sat.tac	Tue Dec 01 06:07:20 2009 +0100
@@ -384,8 +384,15 @@
 
     def registerNewAccountCB(self, id, data):
         user = jid.parse(self.memory.getParamA("JabberID", "Connection"))[0]
+        password = self.memory.getParamA("Password", "Connection")
         server = self.memory.getParamA("Server", "Connection")
 
+        if not user or not password or not server:
+            info ('No user or server given')
+            #TODO: a proper error message must be sent to frontend
+            self.actionResult(id, "ERROR", {'message':"No user, password or server given, can't register new account."})
+            return
+
         confirm_id = sat_next_id()
         self.__private_data[confirm_id]=id