Detect stale current student on startup
authorJakob Cornell <jakob@jcornell.net>
Sat, 4 Jan 2020 07:18:33 +0000 (01:18 -0600)
committerJakob Cornell <jakob@jcornell.net>
Sat, 4 Jan 2020 07:18:33 +0000 (01:18 -0600)
main.py

diff --git a/main.py b/main.py
index 3e87b46bee333c3cb556b1488f9ebdf61de30afb..e63d62322c466cbd45ab9573b7b832f564066e0c 100644 (file)
--- a/main.py
+++ b/main.py
@@ -89,6 +89,8 @@ class MainModel(Model):
                self.state_mgr = state_mgr
                state = self.state_mgr.load()
                self.state = state or new_app_state()
+               if self.state['student'] is not None and self.state['student'] not in self.data:
+                       self.state['student'] = None
 
                self.saved = False
                self.dirty = False