From 3ec9f167d406694bc400568c46d9366ceb8699c8 Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Thu, 15 Jan 2009 05:21:59 +0000 Subject: [PATCH] Protect against the User object getting out of sync with the respective Object's name. --- src/session.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/session.py b/src/session.py index af51acccd5..d04d435f20 100755 --- a/src/session.py +++ b/src/session.py @@ -173,6 +173,11 @@ class SessionProtocol(StatefulTelnetProtocol): user.last_login = datetime.now() user.save() + # In case the account and the object get out of sync, fix it. + if pobject.name != user.username: + pobject.set_name(user.username) + pobject.save() + def msg(self, message): """ Sends a message to the session.