def event_create(values): new_event = api_base.entity_create(models.TimeLineEvent, values) if new_event: if new_event.story_id is not None: stories_api.story_update_updated_at(new_event.story_id) # TODO(SotK): Update board and worklist updated_at when they get events if CONF.enable_notifications: # Build the payload. Use of None is included to ensure that we don't # accidentally blow up the API call, but we don't anticipate it # happening. event_dict = tojson(TimeLineEvent, TimeLineEvent.from_db_model(new_event)) publish(author_id=request.current_user_id or None, method="POST", url=request.headers.get('Referer') or None, path=request.path or None, query_string=request.query_string or None, status=response.status_code or None, resource="timeline_event", resource_id=new_event.id or None, resource_after=event_dict or None) return new_event
def task_update(task_id, values): task = api_base.entity_update(models.Task, task_id, values) if task: stories_api.story_update_updated_at(task.story_id) # Update updated_at in projects when task is updated projects_api.project_update_updated_at(task.project_id) return task
def task_delete(task_id): task = task_get(task_id) if task: stories_api.story_update_updated_at(task.story_id) # Update updated_at in projects when task/story is deleted projects_api.project_update_updated_at(task.project_id) api_base.entity_hard_delete(models.Task, task_id)
def task_delete(task_id): task = task_get(task_id) if task: stories_api.story_update_updated_at(task.story_id) api_base.entity_hard_delete(models.Task, task_id)
def task_update(task_id, values): task = api_base.entity_update(models.Task, task_id, values) if task: stories_api.story_update_updated_at(task.story_id) return task