Пример #1
0
def update(slug):
    project = object_or_404(Project.by_slug(slug))
    authz.require(authz.project_manage(project))
    data = request_data({'author': request.account})
    project = projects.save(data, project=project)
    db.session.commit()
    return jsonify(projects.to_rest(project))
Пример #2
0
def update(slug):
    project = object_or_404(Project.by_slug(slug))
    authz.require(authz.project_manage(project))
    data = request_data({'author': request.account})
    project = projects.save(data, project=project)
    db.session.commit()
    return jsonify(projects.to_rest(project))
Пример #3
0
def view(slug):
    project = object_or_404(Project.by_slug(slug))
    validate_cache(last_modified=project.updated_at)
    return jsonify(projects.to_rest(project))
Пример #4
0
def create():
    authz.require(authz.project_create())
    project = projects.save(request_data({'author': request.account}))
    db.session.commit()
    return jsonify(projects.to_rest(project), status=201)
Пример #5
0
def view(slug):
    project = object_or_404(Project.by_slug(slug))
    authz.require(authz.project_read(project))
    if not project.private:
        validate_cache(last_modified=project.updated_at)
    return jsonify(projects.to_rest(project))
Пример #6
0
def create():
    authz.require(authz.project_create())
    project = projects.save(request_data({'author': request.account}))
    db.session.commit()
    return jsonify(projects.to_rest(project), status=201)