Fixed the strange login error reported in issue103.

This commit is contained in:
Griatch 2010-09-05 15:05:40 +00:00
parent a2291953f2
commit c4128e4656
2 changed files with 10 additions and 5 deletions

View file

@ -88,8 +88,7 @@ def import_cmdset(python_path, cmdsetobj, emit_to_obj=None, no_logging=False):
try:
try:
wanted_cache_key = python_path
print "inport cmdsets: cache=", CACHED_CMDSETS
wanted_cache_key = python_path
cmdsetclass = CACHED_CMDSETS.get(wanted_cache_key, None)
errstring = ""
if not cmdsetclass:

View file

@ -33,9 +33,15 @@ def returns_player_list(method):
try:
players.append(user.get_profile())
except Exception:
print players
print user, user.__class__
logger.log_trace("User has no profile(), maybe database was partially reset?")
# there is something wrong with get_profile. But
# there is a 1-1 relation between Users-Players, so we
# 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 func