def delete(self):
     req_data = json.loads(json.dumps(request.form))
     account_id = int(req_data["account_id"])
     try:
         res = DBsession.query(
             aws_model.WinXinAcount).filter_by(id=account_id).first()
         setattr(res, "data_status", False)
         DBsession.commit()
     except exc.SQLAlchemyError:
         aws_model.DBsession.rollback()
     else:
         acc_obj = aws_model.WinXinAcount()
         res_acc = acc_obj.get_accunt
         return res_acc, 200, None
Example #2
0
    def delete(self):
        req_data = json.loads(json.dumps(request.form))
        account_ids = eval(req_data["data"])["account_id"]
        if isinstance(account_ids, int):
            account_ids = str(account_ids)
        for account_id in account_ids:
            account_id = int(account_id)
            try:
                DBsession.query(aws_model.OpsAccountManage).filter_by(
                    id=account_id).delete()
                DBsession.commit()
            except exc.SQLAlchemyError:
                aws_model.DBsession.rollback()

        acc_obj = aws_model.OpsAccountManage()
        res_acc = acc_obj.get_accunt

        return res_acc, 200, None
Example #3
0
    def delete(self):
        req_data = json.loads(json.dumps(request.form))
        account_ids = eval(req_data["data"])["account_id"]
        if isinstance(account_ids, int):
            account_ids = str(account_ids)
        for account_id in account_ids:
            account_id = int(account_id)
            try:
                res = DBsession.query(
                    aws_model.CmdbUser).filter_by(id=account_id).first()
                setattr(res, "data_status", False)
                DBsession.commit()
            except exc.SQLAlchemyError:
                aws_model.DBsession.rollback()

        acc_obj = aws_model.CmdbUser()
        res_acc = acc_obj.get_accunt

        return res_acc, 200, None