예제 #1
0
    def put(self, aid):
        submit = self.request()
        access = Access.get(aid)
        if access["status"] != ACCESS.APPROVAL:
            raise ExceptionEx("申请未提交")

        submit["approval_uid"] = session.get_uid()
        submit["approval_time"] = datetime.now()
        submit["id"] = aid
        Access.edit(submit)
        return self.succ()
예제 #2
0
    def put(self, aid):
        submit = self.request()
        access = Access.get(aid)
        if access["status"] != ACCESS.APPROVAL:
            raise ExceptionEx("申请未提交")

        submit["approval_uid"] = session.get_uid()
        submit["approval_time"] = datetime.now()
        submit["id"] = aid
        Access.edit(submit)
        return self.succ()
예제 #3
0
    def put(self, aid):
        submit = self.request()
        submit["id"] = aid
        if submit.__contains__("content"):
            submit["content"] = json.dumps(submit["content"])

        access = Access.edit(submit, auto_commit=False)

        if submit["status"] == ACCESS.APPROVAL:
            mail = Mail()
            if not mail.to(access):
                raise ExceptionEx("邮件发送失败")

        db.session.commit()
        return self.succ()
예제 #4
0
파일: access.py 프로젝트: xutaoding/bmp
    def put(self, aid):
        submit = self.request()
        submit["id"] = aid
        if submit.__contains__("content"):
            submit["content"] = json.dumps(submit["content"])

        access = Access.edit(submit, auto_commit=False)

        if submit["status"] == ACCESS.APPROVAL:
            mail = Mail()
            if not mail.to(access):
                raise ExceptionEx("邮件发送失败")

        db.session.commit()
        return self.succ()