コード例 #1
0
ファイル: auth.py プロジェクト: geekcubed/hll_rcon_tool
def is_logged_in(request):
    res = request.user.is_authenticated
    if res:
        try:
            steam_id = None
            try:
                steam_id = request.user.steamplayer.steam_id_64
            except:
                logger.warning("%s's steam id is not set ",
                               request.user.username)
            heartbeat(request.user.username, steam_id)
            set_registered_mods(
                [u.steam_id_64 for u in SteamPlayer.objects.all()])
        except:
            logger.exception("Can't record heartbeat")

    return api_response(result=res, command="is_logged_in", failed=False)
コード例 #2
0
def is_logged_in(request):
    res = request.user.is_authenticated
    if res:
        try:
            steam_id = None
            try:
                steam_id = request.user.steamplayer.steam_id_64
            except:
                logger.warning("%s's steam id is not set ",
                               request.user.username)
            try:
                heartbeat(request.user.username, steam_id)
            except:
                logger.exception("Unable to register mods")
        except:
            logger.exception("Can't record heartbeat")

    return api_response(result=res, command="is_logged_in", failed=False)