Merge pull request #3324 from volundmush/signal_refactor

SIGNAL_ACCOUNT_POST_LOGIN_FAIL is now properly used. Added a CUSTOM_S…
This commit is contained in:
Griatch 2023-11-23 18:47:36 +01:00 committed by GitHub
commit 1f25987cd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -33,6 +33,7 @@ from evennia.server.signals import (
SIGNAL_ACCOUNT_POST_CREATE,
SIGNAL_OBJECT_POST_PUPPET,
SIGNAL_OBJECT_POST_UNPUPPET,
SIGNAL_ACCOUNT_POST_LOGIN_FAIL,
)
from evennia.server.throttle import Throttle
from evennia.typeclasses.attributes import ModelAttributeBackend, NickHandler
@ -676,6 +677,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
if session:
account = AccountDB.objects.get_account_from_name(username)
if account:
SIGNAL_ACCOUNT_POST_LOGIN_FAIL.send(sender=account, session=session)
account.at_failed_login(session)
return None, errors