Format code with black. Add makefile to run fmt/tests
This commit is contained in:
parent
d00bce9288
commit
c2c7fa311a
299 changed files with 19037 additions and 11611 deletions
|
|
@ -5,7 +5,8 @@ The managers for the custom Account object and permissions.
|
|||
import datetime
|
||||
from django.utils import timezone
|
||||
from django.contrib.auth.models import UserManager
|
||||
from evennia.typeclasses.managers import (TypedObjectManager, TypeclassManager)
|
||||
from evennia.typeclasses.managers import TypedObjectManager, TypeclassManager
|
||||
|
||||
__all__ = ("AccountManager",)
|
||||
|
||||
|
||||
|
|
@ -13,6 +14,7 @@ __all__ = ("AccountManager",)
|
|||
# Account Manager
|
||||
#
|
||||
|
||||
|
||||
class AccountDBManager(TypedObjectManager, UserManager):
|
||||
"""
|
||||
This AccountManager implements methods for searching
|
||||
|
|
@ -90,8 +92,7 @@ class AccountDBManager(TypedObjectManager, UserManager):
|
|||
end_date = timezone.now()
|
||||
tdelta = datetime.timedelta(days)
|
||||
start_date = end_date - tdelta
|
||||
return self.filter(last_login__range=(
|
||||
start_date, end_date)).order_by('-last_login')
|
||||
return self.filter(last_login__range=(start_date, end_date)).order_by("-last_login")
|
||||
|
||||
def get_account_from_email(self, uemail):
|
||||
"""
|
||||
|
|
@ -176,7 +177,8 @@ class AccountDBManager(TypedObjectManager, UserManager):
|
|||
# try alias match
|
||||
matches = self.filter(
|
||||
db_tags__db_tagtype__iexact="alias",
|
||||
**{"db_tags__db_key__iexact" if exact else "db_tags__db_key__icontains": ostring})
|
||||
**{"db_tags__db_key__iexact" if exact else "db_tags__db_key__icontains": ostring},
|
||||
)
|
||||
return matches
|
||||
|
||||
# back-compatibility alias
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue