def task_detail(child_id): child = users.get_child_data(child_id) childs_tasks = tasks.get_tasks(child_id) childs_points_history = points.get_points_history(child_id) role = g.user_data['role'] child_points = points.get_child_points(child['id']) context = {'child': child, 'childs_tasks': childs_tasks, 'childs_points_history': childs_points_history, 'role': role, 'child_points': child_points } return render_template('tasks/task_detail.html', **context)
def prizes_detail(child_id): role = g.user_data['role'] try: child = users.get_child_data(child_id) except TypeError: return abort(403) childs_prizes = prizes.get_prizes(child_id) child_points = points.get_child_points(child['id']) childs_points_history = points.get_points_history(child_id) context = {'child': child, 'childs_prizes': childs_prizes, 'role': role, 'child_points': child_points, 'childs_points_history': childs_points_history } return render_template('prizes/prizes_detail.html', **context)