Fixed the strange login error reported in issue103.
This commit is contained in:
parent
a2291953f2
commit
c4128e4656
2 changed files with 10 additions and 5 deletions
|
|
@ -88,8 +88,7 @@ def import_cmdset(python_path, cmdsetobj, emit_to_obj=None, no_logging=False):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
wanted_cache_key = python_path
|
wanted_cache_key = python_path
|
||||||
print "inport cmdsets: cache=", CACHED_CMDSETS
|
|
||||||
cmdsetclass = CACHED_CMDSETS.get(wanted_cache_key, None)
|
cmdsetclass = CACHED_CMDSETS.get(wanted_cache_key, None)
|
||||||
errstring = ""
|
errstring = ""
|
||||||
if not cmdsetclass:
|
if not cmdsetclass:
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,15 @@ def returns_player_list(method):
|
||||||
try:
|
try:
|
||||||
players.append(user.get_profile())
|
players.append(user.get_profile())
|
||||||
except Exception:
|
except Exception:
|
||||||
print players
|
# there is something wrong with get_profile. But
|
||||||
print user, user.__class__
|
# there is a 1-1 relation between Users-Players, so we
|
||||||
logger.log_trace("User has no profile(), maybe database was partially reset?")
|
# try to go the other way instead.
|
||||||
|
from src.players.models import PlayerDB
|
||||||
|
match = PlayerDB.objects.filter(user=user)
|
||||||
|
if match:
|
||||||
|
players.append(match[0])
|
||||||
|
else:
|
||||||
|
logger.log_trace("No connection User<->Player, maybe database was partially reset?")
|
||||||
return players
|
return players
|
||||||
return func
|
return func
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue