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
Fixed bug in get_all_mail. #1262
Conversation
db_receivers_players=self.caller needed to be changed to self.caller.player
This change causes it to fail its unittest. |
The test failure is almost identical to the issue I fixed in PR #1265, where the evennia making an assumption about whether the account is ooc or puppeting. Maybe that determination needs to be baked in at a higher level in the code? |
Here are the tests for this contrib at https://github.com/evennia/evennia/blob/master/evennia/contrib/tests.py#L540 It's helpful to know which test failed and what error was given, so I ran Running the test without patching passes: OK
ERROR: test_mail (evennia.contrib.tests.TestMail)Traceback (most recent call last): Ran 200 tests in 66.805s FAILED (errors=1)
|
This error can happen anywhere a command that is available both ooc and puppeting and something on the Player (or Account, post #1174) needs to be accessed. Checking for the AttributeError exception every time .player is accessed seems to be not very DRY. |
Confusion about |
@BlauFeuer If that's the case I'm going to revisit #1265 |
The default commands inherit from evennia.commands.default.muxcommand.MuxCommand, and so the caveat is ... this code only engages when |
So the fix for this should just be to use self.player then. |
@eldritchsemblance If you changed line 91 to filter on If you just add This leads me to believe that a successful PR would have to also update the unit tests. |
@BlauFeuer @grungies1138 The change as is simply changes the point of failure from while puppeting to while ooc. The same change I applied to #1265 before @BlauFeuer advice works here, all unit tests pass, and the mail system works both ooc and while puppeting:
Fixed this in pull request #1289 |
The regression was fixed by @eldritchsemblance in #1289. Closing. |
db_receivers_players=self.caller needed to be changed to self.caller.player
Brief overview of PR changes/additions
Motivation for adding to Evennia
Other info (issues closed, discussion etc)