Rename all instances of Player->Account.
This commit is contained in:
parent
a14e11640b
commit
5590ee2258
94 changed files with 1316 additions and 2327 deletions
|
|
@ -8,7 +8,7 @@ from __future__ import print_function
|
|||
from django.shortcuts import render
|
||||
from django.contrib.auth import login, authenticate
|
||||
|
||||
from evennia.players.models import PlayerDB
|
||||
from evennia.accounts.models import AccountDB
|
||||
from evennia.utils import logger
|
||||
|
||||
|
||||
|
|
@ -18,24 +18,24 @@ def _shared_login(request):
|
|||
|
||||
"""
|
||||
csession = request.session
|
||||
player = request.user
|
||||
account = request.user
|
||||
sesslogin = csession.get("logged_in", None)
|
||||
|
||||
# check if user has authenticated to website
|
||||
if csession.session_key is None:
|
||||
# this is necessary to build the sessid key
|
||||
csession.save()
|
||||
elif player.is_authenticated():
|
||||
elif account.is_authenticated():
|
||||
if not sesslogin:
|
||||
# User has already authenticated to website
|
||||
csession["logged_in"] = player.id
|
||||
csession["logged_in"] = account.id
|
||||
elif sesslogin:
|
||||
# The webclient has previously registered a login to this browser_session
|
||||
player = PlayerDB.objects.get(id=sesslogin)
|
||||
account = AccountDB.objects.get(id=sesslogin)
|
||||
try:
|
||||
# calls our custom authenticate in web/utils/backends.py
|
||||
player = authenticate(autologin=player)
|
||||
login(request, player)
|
||||
account = authenticate(autologin=account)
|
||||
login(request, account)
|
||||
except AttributeError:
|
||||
logger.log_trace()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue