Skip to content

🐛 Fix 'KeyError' exception on 'session' key#13

Merged
davafons merged 1 commit intomasterfrom
fix-10
Jun 21, 2019
Merged

🐛 Fix 'KeyError' exception on 'session' key#13
davafons merged 1 commit intomasterfrom
fix-10

Conversation

@davafons
Copy link
Copy Markdown
Collaborator

Add a static function in Session class to get the Session object from a user_data, creating it
if isn't already defined (due to a server restart, for example). Works like a "getter for a
singleton instance"
.

Also, avoids putting user_data["session"] directly, which is error prone.

Now the user will be able to use old menus even if the server is restarted.

Closes #10

Add a static function in Session to get the Session object from the `user_data`, creating the object
if isn't already defined (due to a server restart, for example). Works like a "getter for a
singleton instance".

Also, avoids putting `user_data["session"]` directly, which is error prone.

Closes #10
@davafons davafons closed this Jun 21, 2019
@davafons davafons deleted the fix-10 branch June 21, 2019 15:56
@davafons davafons restored the fix-10 branch June 21, 2019 15:57
@davafons davafons reopened this Jun 21, 2019
@davafons davafons merged commit 9e48c7e into master Jun 21, 2019
@davafons davafons deleted the fix-10 branch June 21, 2019 15:58
@davafons davafons added the fix Fix a bug label Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fix a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KeyError exception with 'session' after restaring the server

1 participant