-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix save class #2090
Fix save class #2090
Conversation
I think the reason I did that was if someone sent new arguments it would load those, and not keep the old ones. For example. With the new menu if you type in the following commands: |
I see. But in that case we never save any class that has arguments to be init with, right? |
They way I remember it working is that if any changes happen it loads again but if nothing changes it stays the same. |
The way I'm reading this is that if the controller you call has more than 1 input (self.queue) then it always generates a new menu. Which from my testing it's what was always happening. When you remove that condition |
One thing we could do is save the args and kwargs sent the last time in the dict. If they are the same we load if not we generate a new one. |
They are already loaded and saved. You can access the saved using |
I guess we need to mock |
We are good here @piiq |
Fixes #2053
Even though we exit/reset we want to save class so that if we need the attributes on one of the levels above, we don't get an issue.
I also noticed that we weren't saving a class unless it only received the queue as a parameter. I added a comment that explains what's happening in there. There's no right or wrong about it - but it's important to understand why it's there.