def get_or_create_status(name): """ Return given status. If it does not exist, it creates it. """ project_status = ProjectStatus.get_by(name=name) if project_status is None: project_status = ProjectStatus(name=name, color="#000000") project_status.save() return project_status.serialize()
def get_or_create_status(name): project_status = ProjectStatus.get_by(name=name) if project_status is None: project_status = ProjectStatus(name=name, color="#000000") project_status.save() return project_status.serialize()