def create(): session.rollback() data = deepcopy(request.data) data.update({"created_by_id": request.user["id"]}) result = query_helper.save(session, BoardUser, data, json_result=True) log_helper.log_insert(session, BoardUser, request.user["id"], result) session.commit() return json_dumps(model_helper.insert_field_objects(session, result))
def create(): session.rollback() result = query_helper.save(session, CardList, request.data, json_result=True) log_helper.log_insert(session, CardList, request.user["id"], result) session.commit() return json_dumps(model_helper.insert_field_objects(session, result))
def setup_admin_account(_id): if not query_helper.find_by_id(session, User, _id): query_helper.save( session, User, { "id": _id, "email": "*****@*****.**", "username": "******", "password": password_helper.encrypt_password(str("password").strip()), "created_by_id": _id, "created_at": datetime.utcnow() }) session.commit()
def signup(): session.rollback() data = deepcopy(request.data) data.update({ "created_at": datetime.utcnow(), "created_by_id": request.user["id"] }) if 'password' in data: data['password'] = password_helper.encrypt_password( str(data['password']).strip()) result = query_helper.save(session, User, data, json_result=True) log_helper.log_insert(session, User, request.user["id"], result) session.commit() return json_dumps(model_helper.insert_field_objects(session, result))