コード例 #1
0
ファイル: views.py プロジェクト: kallama/allianceauth
def main_character_change(request, char_id):
    logger.debug("main_character_change called by user %s for character id %s" % (request.user, char_id))
    if EveManager.check_if_character_owned_by_user(char_id, request.user):
        AuthServicesInfoManager.update_main_char_Id(char_id, request.user)
        set_state(request.user)
        return HttpResponseRedirect("/characters")
    return HttpResponseRedirect("/characters")
コード例 #2
0
def main_character_change(request, char_id):
    logger.debug(
        "main_character_change called by user %s for character id %s" %
        (request.user, char_id))
    if EveManager.check_if_character_owned_by_user(char_id, request.user):
        AuthServicesInfoManager.update_main_char_Id(char_id, request.user)
        set_state(request.user)
        return HttpResponseRedirect("/characters/")
    return HttpResponseRedirect("/characters/")
コード例 #3
0
ファイル: views.py プロジェクト: RichterSR/allianceauth
def user_refresh_api(request, api_id):
    logger.debug("user_refresh_api called by user %s for api id %s" % (request.user, api_id))
    if EveApiKeyPair.objects.filter(api_id=api_id).exists():
        api_key_pair = EveApiKeyPair.objects.get(api_id=api_id)
        if api_key_pair.user == request.user:
            refresh_api(api_key_pair)
            set_state(request.user)
        else:
            logger.warn("User %s not authorized to refresh api id %s" % (request.user, api_id))
    else:
        logger.warn("User %s unable to refresh api id %s - api key not found" % (request.user, api_id))
    return HttpResponseRedirect("/api_key_management/")
コード例 #4
0
def user_refresh_api(request, api_id):
    logger.debug("user_refresh_api called by user %s for api id %s" %
                 (request.user, api_id))
    if EveApiKeyPair.objects.filter(api_id=api_id).exists():
        api_key_pair = EveApiKeyPair.objects.get(api_id=api_id)
        if api_key_pair.user == request.user:
            refresh_api(api_key_pair)
            set_state(request.user)
        else:
            logger.warn("User %s not authorized to refresh api id %s" %
                        (request.user, api_id))
    else:
        logger.warn("User %s unable to refresh api id %s - api key not found" %
                    (request.user, api_id))
    return HttpResponseRedirect("/api_key_management/")