• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python utils.check_auth函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中utils.check_auth函数的典型用法代码示例。如果您正苦于以下问题:Python check_auth函数的具体用法?Python check_auth怎么用?Python check_auth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了check_auth函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: web_add_user

def web_add_user(request):

    result = {'success': False}
    #if True:
    try:
    
        user, token = check_auth(request)
        
        organization_id = request.POST['organization_id']
        user_type_id = request.POST['user_type_id']
        first = request.POST['first']
        last = request.POST['last']
        email = request.POST['email']
        password = request.POST['password']

        
        new_user = add_user(
            user = user,
            organization_id = organization_id,
            user_type_id = user_type_id,
            first = first,
            last = last,
            email = email,
            password = password,
        )
        
        result['new_user_id'] = new_user.id
        
        result['success'] = True
        
    except:
        pass
        
    return make_response(result)
开发者ID:thequbit,项目名称:bits,代码行数:34,代码来源:views.py


示例2: web_complete_task

def web_complete_task(request):

    """ Complete a task
    """

    result = {'user': None}
    result['success'] = False

    #if True:
    try:

        user, token = check_auth(request)

        task_id = request.POST['task_id']
        
        task = complete_task(user, task_id);

        result['task_id'] = task.id

        result['success'] = True

    except:
       pass

    return make_response(result)
开发者ID:thequbit,项目名称:bits,代码行数:25,代码来源:views.py


示例3: web_close_ticket

def web_close_ticket(request):

    """ Create a new ticket
    """

    result = {'user': None}
    result['success'] = False

    #if True:
    try:

        user, token = check_auth(request)

        ticket_id = request.POST['ticket_id']
        
        ticket = close_ticket(user, ticket_id);

        result['ticket_id'] = ticket.id

        result['success'] = True

    except:
        pass

    return make_response(result)
开发者ID:thequbit,项目名称:bits,代码行数:25,代码来源:views.py


示例4: decorated

	def decorated(*args, **kwargs):
		auth = request.authorization
		if not auth:
			return authenticate()
		elif not check_auth(auth.username, auth.password):
			return authenticate()
		return f(*args, **kwargs)
开发者ID:cassac,项目名称:api_demo,代码行数:7,代码来源:messages.py


示例5: web_assign_user_to_project

def web_assign_user_to_project(request):
    """ Assign a user to a project
    """

    result = {}
    #if True:
    try:

        user, token = check_auth(request)
        
        project_id = int(request.POST['project_id'])
        email = request.POST['email']

        target_user, assignment = assign_user_to_project(
            user = user,
            project_id = project_id,
            email = email,
        )
    
        if assignment != None:
            result['assignment_id'] = assignment.id
        else:
            result['assignment_id'] = -1;
            
        result['project_id'] =  project_id
        result['user_id'] = target_user.id
    
        result['success'] = True

    except:
        pass

    return make_response(result)
开发者ID:thequbit,项目名称:bits,代码行数:33,代码来源:views.py


示例6: upload

    def upload():

        if 'client' in config and 'user' in config["client"] and 'pass' in config["client"]:
            auth_control = check_auth(config)
            if auth_control:
                return auth_control

        _file = request.files.get("file")
        if not _file:
            return "a file named as 'file' required", 400

        if not allowed_file(_file.filename, config):
            return "invalid file type", 400

        filename = secure_filename(_file.filename)
        full_filename = os.path.join(app.config['UPLOAD_FOLDER'], filename)

        try:
            full_filename = get_available_filename(full_filename)
        except ValueError as error:
            return error.message, 400

        _file.save(full_filename)

        return os.path.split(full_filename)[1], 201
开发者ID:carriercomm,项目名称:usta,代码行数:25,代码来源:server.py


示例7: web_tasks

def web_tasks(request):

    result = {'user': None}
    #if True:
    try:

        user, token = check_auth(request)
        result['user'] = user

        project_id = int(request.GET['project_id'])

        completed = False
        try:
            completed = int(request.GET['completed']);
        except:
            pass

        result['completed'] = completed

        result['tasks'] = get_tasks(project_id, completed)

        result['project'] = get_project(user.id, project_id)

    except:
        pass

    return result 
开发者ID:thequbit,项目名称:bits,代码行数:27,代码来源:views.py


示例8: web_ticket

def web_ticket(request):

    result = {'user': None}
    #if True:
    try:

        user, token = check_auth(request)
        result['user'] = user

        ticket_id = request.GET['ticket_id']
        #project_id = request.GET['project_id']

        ticket = get_ticket(
            user_id = user.id, 
            ticket_id = ticket_id,
        )
        
        result['ticket'] = ticket

        result['comments'] = get_ticket_comments(user.id, ticket['id'])

        result['tickets'] = get_tickets(ticket['project_id'])

        result['assigned_users'] = get_users_assigned_to_project(user.id, ticket['project_id'])

        result['project'] = get_project(user.id, ticket['project_id'])

    except:
        pass

    return result
开发者ID:thequbit,项目名称:bits,代码行数:31,代码来源:views.py


示例9: web_owner_tickets

def web_owner_tickets(request):

    result = {'user': None}
    #if True:
    try:

        user, token = check_auth(request)
        result['user'] = user

        project_id = int(request.GET['project_id'])

        result['tickets'] = get_tickets(
            project_id = project_id,
            closed = False,
            unassigned = False,
            user_id = user.id,
            opened = True,
        )

        result['project'] = get_project(user.id, project_id)

    except:
        pass

    return result 
开发者ID:thequbit,项目名称:bits,代码行数:25,代码来源:views.py


示例10: web_projects

def web_projects(request):

    result = {'user': None}
    #if True:
    try:

        user, token = check_auth(request)
        result['user'] = user

        result['projects'] = get_user_projects(user) #build_index_projects(user, limit=25)

        #project_id = request.GET['project_id']
            
        #result['project'] = get_project(user.id, project_id)

        #result['tasks'] = get_tasks(project_id, completed=False)

        #result['tickets'] = get_tickets(project_id)

        #result['lists'] = [] #get_lists(project_id)

    except:
        pass

    return result
开发者ID:thequbit,项目名称:bits,代码行数:25,代码来源:views.py


示例11: web_task

def web_task(request):

    result = {'user': None}
    #if True:
    try:

        user, token = check_auth(request)
        result['user'] = user

        task_id = request.GET['task_id']
        #project_id = request.GET['project_id']

        task = get_task(task_id)
        result['task'] = task

        result['comments'] = get_task_comments(task['id'])

        result['tasks'] = get_tasks(task['project_id'], completed=False)

        result['project'] = get_project(user.id, task['project_id'])


    except:
        pass

    return result
开发者ID:thequbit,项目名称:bits,代码行数:26,代码来源:views.py


示例12: web_create_task

def web_create_task(request):
    """ Get all of the organizations that the user has access to
    """
    
    result = {'user': None}
    result['success'] = False

    #if True:
    try:

        user, token = check_auth(request)

        project_id = request.POST['project_id']
        title = request.POST['title']
        contents = request.POST['contents']
        assigned_id = request.POST['assigned_id']
        due = request.POST['due']

        task = create_new_task(
            user = user,
            project_id = project_id,
            title = title,
            contents = contents,
            assigned_id = assigned_id,
            due = due,
        )
        
        result['task_id'] = task.id;
        
        result['success'] = True

    except:
        pass

    return make_response(result)
开发者ID:thequbit,项目名称:bits,代码行数:35,代码来源:views.py


示例13: web_assign_user_to_ticket

def web_assign_user_to_ticket(request):

    result = {'success': False}
    
    #if True:
    try:
    
        user, token = check_auth(request)
    
        ticket_id = request.POST['ticket_id']
        email = request.POST['email']
        
        unassign = False
        try:
            unassign = str2bool(request.POST['unassign'])
        except:
            pass
            
        assign_user_to_ticket(
            user = user,
            ticket_id = ticket_id,
            email = email,
            unassign = unassign,
        )
    
        result['ticket_id'] = ticket_id
    
        result['success'] = True
    
    except:
        pass

    return make_response(result)
开发者ID:thequbit,项目名称:bits,代码行数:33,代码来源:views.py


示例14: web_update_ticket_title

def web_update_ticket_title(request):

    result = {'success': False}

    #if True:
    try:

        user, token = check_auth(request)

        ticket_id = request.POST['ticket_id']
        title = request.POST['title']

        update_ticket_title(
            user = user,
            ticket_id = ticket_id,
            title = title,
        )

        result['ticket_id'] = ticket_id

        result['success'] = True

    except:
        pass

    return make_response(result)
开发者ID:thequbit,项目名称:bits,代码行数:26,代码来源:views.py


示例15: web_projectsettings

def web_projectsettings(request):

    result = {'user': None}
    #if True:
    try:

        user, token = check_auth(request)
        result['user'] = user

        project_id = request.GET['project_id']
            
        result['project'] = get_project(user.id, project_id)

        result['organization_users'] = get_organization_users(user.organization_id);
        
        result['assigned_users'] = get_users_assigned_to_project(user.id, project_id)

        result['tasks'] = get_tasks(project_id)

        result['tickets'] = get_tickets(project_id)


    except:
        pass

    return result
开发者ID:thequbit,项目名称:bits,代码行数:26,代码来源:views.py


示例16: web_update_ticket_contents

def web_update_ticket_contents(request):

    result = {'success': False}

    #if True:
    try:

        user, token = check_auth(request)

        ticket_id = request.POST['ticket_id']
        contents = request.POST['contents']

        update_ticket_contents(
            user_id = user.id,
            ticket_id = ticket_id,
            contents = contents,
        )

        result['ticket_id'] = ticket_id

        result['success'] = True

    except:
        pass

    return make_response(result)
开发者ID:thequbit,项目名称:bits,代码行数:26,代码来源:views.py


示例17: web_index

def web_index(request):

    result = {'user': None}
    #if True:
    try:

        user, token = check_auth(request)
        result['user'] = user

        result['projects'] = build_index_projects(user, limit=25)

        #result['projects'] = get_user_projects(user)

        #result['ticket_assignments'] = get_ticket_assignments(user, limit=25)
        
        #result['task_assignments'] = get_task_assignments(user, limit=25)

        actions = get_actions(user, limit=25)
        
        result['actions'] = actions
        
    except:
        pass

    return result
开发者ID:thequbit,项目名称:bits,代码行数:25,代码来源:views.py


示例18: web_create_project

def web_create_project(request):
    """ Create a new project
    """

    result = {'user': None}
    #if True:
    try:

        user, token = check_auth(request)

        name = request.POST['name']
        description = request.POST['description']

        project = create_new_project(
            user= user, 
            name = name,
            description = description,
        )
        
        result['project_id'] = project.id
        
        result['success'] = True

    except:
        pass

    return make_response(result)
开发者ID:thequbit,项目名称:bits,代码行数:27,代码来源:views.py


示例19: web_manage_project

def web_manage_project(request):

    result = {'user': None}
    #if True:
    try:

        user, token = check_auth(request)

        project_id = request.GET['project_id']

        result['user'] = user

        result['project'] = get_project(user.id, project_id)
        
        result['tasks'] = get_tasks(project_id, completed=False)

        result['tickets'] = get_tickets(project_id)

        result['lists'] = [] #get_lists(project_id)

        #result['projects'] = get_projects(user);

    except:
        pass

    return result
开发者ID:thequbit,项目名称:bits,代码行数:26,代码来源:views.py


示例20: interface_show_view

def interface_show_view(request):
    data = {}
    data["auth"] = utils.check_auth(request)
    data["urlHost"] = data_utils.get_url_host_list()
    data["api"] = data_utils.get_api(request.GET.get("id"))
    data["structure"] = data_utils.get_data_structure()
    data["mob_version"] = data_utils.get_mob_version_list()
    return render(request, 'interface_show.html', {"data": data})
开发者ID:sdgdsffdsfff,项目名称:api,代码行数:8,代码来源:views.py



注:本文中的utils.check_auth函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.check_db_read_write函数代码示例发布时间:2022-05-26
下一篇:
Python utils.check函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap