Exemple #1
0
def delete_space(space_id):
    space = Space.query.filter(
        Space.id == space_id,
        Space.author_id == current_user.profile.id).first()
    if not space:
        raise InvalidUsage.space_not_found()
    space.delete()
    return '', 200
Exemple #2
0
def delete_space_from_project(space_id, project_id):
    space = Space.get_by_id(space_id)
    if not space:
        raise InvalidUsage.space_not_found()
    project = Project.get_by_id(project_id)
    if not project:
        raise InvalidUsage.project_not_found()
    project.remove_space(space)
    project.save()
    return '', 200
Exemple #3
0
def get_space(space_id):
    space = Space.get_by_id(space_id)
    if not space:
        raise InvalidUsage.space_not_found()
    return space