Rename all instances of Player->Account.
This commit is contained in:
parent
a14e11640b
commit
5590ee2258
94 changed files with 1316 additions and 2327 deletions
|
|
@ -15,12 +15,12 @@ class CaseInsensitiveModelBackend(ModelBackend):
|
|||
Args:
|
||||
username (str, optional): Name of user to authenticate.
|
||||
password (str, optional): Password of user
|
||||
autologin (Player, optional): If given, assume this is
|
||||
an already authenticated player and bypass authentication.
|
||||
autologin (Account, optional): If given, assume this is
|
||||
an already authenticated account and bypass authentication.
|
||||
"""
|
||||
if autologin:
|
||||
# Note: Setting .backend on player is critical in order to
|
||||
# be allowed to call django.auth.login(player) later. This
|
||||
# Note: Setting .backend on account is critical in order to
|
||||
# be allowed to call django.auth.login(account) later. This
|
||||
# is necessary for the auto-login feature of the webclient,
|
||||
# but it's important to make sure Django doesn't change this
|
||||
# requirement or the name of the property down the line. /Griatch
|
||||
|
|
@ -29,12 +29,12 @@ class CaseInsensitiveModelBackend(ModelBackend):
|
|||
else:
|
||||
# In this case .backend will be assigned automatically
|
||||
# somewhere along the way.
|
||||
Player = get_user_model()
|
||||
Account = get_user_model()
|
||||
try:
|
||||
player = Player.objects.get(username__iexact=username)
|
||||
if player.check_password(password):
|
||||
return player
|
||||
account = Account.objects.get(username__iexact=username)
|
||||
if account.check_password(password):
|
||||
return account
|
||||
else:
|
||||
return None
|
||||
except Player.DoesNotExist:
|
||||
except Account.DoesNotExist:
|
||||
return None
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ except AttributeError:
|
|||
# Setup lists of the most relevant apps so
|
||||
# the adminsite becomes more readable.
|
||||
|
||||
PLAYER_RELATED = ['Players']
|
||||
ACCOUNT_RELATED = ['Accounts']
|
||||
GAME_ENTITIES = ['Objects', 'Scripts', 'Comms', 'Help']
|
||||
GAME_SETUP = ['Permissions', 'Config']
|
||||
CONNECTIONS = ['Irc']
|
||||
|
|
@ -46,7 +46,7 @@ def general_context(request):
|
|||
return {
|
||||
'game_name': GAME_NAME,
|
||||
'game_slogan': GAME_SLOGAN,
|
||||
'evennia_userapps': PLAYER_RELATED,
|
||||
'evennia_userapps': ACCOUNT_RELATED,
|
||||
'evennia_entityapps': GAME_ENTITIES,
|
||||
'evennia_setupapps': GAME_SETUP,
|
||||
'evennia_connectapps': CONNECTIONS,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue