Fix: LogOut from sessions

This commit is contained in:
Manuel Cortez 2022-11-15 16:15:09 -06:00
parent 3fa39c712e
commit 2caaaa9d87
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790

View File

@ -340,14 +340,16 @@ class Controller(object):
if i.account == name and i.name != name:
delete_buffers.append(i.name)
for i in delete_buffers:
self.destroy_buffer(i, user)
self.destroy_buffer(i, name)
session.db = None
def destroy_buffer(self, buffer_name, account):
buffer = self.search_buffer(buffer_name, account)
if buffer == None: return
buff = self.view.search(buffer.name, buffer.account)
if buff == None: return
def destroy_buffer(self, buffer_name, session_name):
buffer = self.search_buffer(buffer_name, session_name)
if buffer == None:
return
buff = self.view.search(buffer.name, session_name)
if buff == None:
return
self.view.delete_buffer(buff)
self.buffers.remove(buffer)
del buffer