Fix edge case with multiple superusers

This commit is contained in:
Griatch 2019-05-01 19:10:44 +02:00
parent 1e7603024e
commit a630ccd51c
3 changed files with 37 additions and 34 deletions

View file

@ -839,7 +839,7 @@ class DefaultAccount(with_metaclass(TypeclassBase, AccountDB)):
""" """
# if we have saved protocol flags on ourselves, load them here. # if we have saved protocol flags on ourselves, load them here.
protocol_flags = self.attributes.get("_saved_protocol_flags", None) protocol_flags = self.attributes.get("_saved_protocol_flags", {})
if session and protocol_flags: if session and protocol_flags:
session.update_flags(**protocol_flags) session.update_flags(**protocol_flags)

View file

@ -198,6 +198,7 @@ class AMPServerClientProtocol(amp.AMPMultiConnectionProtocol):
operation = kwargs.pop("operation", "") operation = kwargs.pop("operation", "")
server_sessionhandler = self.factory.server.sessions server_sessionhandler = self.factory.server.sessions
try:
if operation == amp.PCONN: # portal_session_connect if operation == amp.PCONN: # portal_session_connect
# create a new session and sync it # create a new session and sync it
server_sessionhandler.portal_connect(kwargs.get("sessiondata")) server_sessionhandler.portal_connect(kwargs.get("sessiondata"))
@ -238,4 +239,6 @@ class AMPServerClientProtocol(amp.AMPMultiConnectionProtocol):
else: else:
raise Exception("operation %(op)s not recognized." % {'op': operation}) raise Exception("operation %(op)s not recognized." % {'op': operation})
except Exception:
logger.log_trace()
return {} return {}

View file

@ -133,7 +133,7 @@ class Session(object):
""" """
if self.account: if self.account:
self.protocol_flags.update(self.account.attributes.get("_saved_protocol_flags", {})) self.protocol_flags.update(self.account.attributes.get("_saved_protocol_flags", None) or {})
# access hooks # access hooks