Protect against the User object getting out of sync with the respective Object's name.

This commit is contained in:
Greg Taylor 2009-01-15 05:21:59 +00:00
parent 914628d385
commit 3ec9f167d4

View file

@ -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.