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: if i.account == name and i.name != name:
delete_buffers.append(i.name) delete_buffers.append(i.name)
for i in delete_buffers: for i in delete_buffers:
self.destroy_buffer(i, user) self.destroy_buffer(i, name)
session.db = None session.db = None
def destroy_buffer(self, buffer_name, account): def destroy_buffer(self, buffer_name, session_name):
buffer = self.search_buffer(buffer_name, account) buffer = self.search_buffer(buffer_name, session_name)
if buffer == None: return if buffer == None:
buff = self.view.search(buffer.name, buffer.account) return
if buff == None: return buff = self.view.search(buffer.name, session_name)
if buff == None:
return
self.view.delete_buffer(buff) self.view.delete_buffer(buff)
self.buffers.remove(buffer) self.buffers.remove(buffer)
del buffer del buffer