Protect against the User object getting out of sync with the respective Object's name.
This commit is contained in:
parent
914628d385
commit
3ec9f167d4
1 changed files with 5 additions and 0 deletions
|
|
@ -173,6 +173,11 @@ class SessionProtocol(StatefulTelnetProtocol):
|
||||||
user.last_login = datetime.now()
|
user.last_login = datetime.now()
|
||||||
user.save()
|
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):
|
def msg(self, message):
|
||||||
"""
|
"""
|
||||||
Sends a message to the session.
|
Sends a message to the session.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue