예제 #1
0
    def post(self, cid):
        weblog.info("%s.", self._request_summary())
        user_belong_to = int(self.get_argument("user_belong_to", 0))
        comp_belong_to = int(self.get_argument("comp_belong_to", 0))
        comp_type = int(self.get_argument("comp_type", -1))
        comp_new = self.get_argument("comp_new", None)
        comp_status = int(self.get_argument("comp_status", -1))
        comp_describe = self.get_argument("comp_describe", None)
        comp_reason = self.get_argument("comp_reason", None)
        comp_solution = self.get_argument("comp_solution", None)
        comment = self.get_argument("comp_new", None)

        msg = []
        if user_belong_to <= 0 or comp_belong_to <= 0:
            msg.append(u"模块或负责人获取失败,不能为空")
        if comp_type < 0 or comp_status < 0:
            msg.append(u"维护方式 或 是否解决,不能为空")
        if comp_type == 0 and (comp_new is None or comp_new == ''):
            msg.append(u"新增内容不能为空")
        if comp_type > 1 and (comp_describe is None or comp_describe == ''):
            msg.append(u"问题描述不能为空")
        comp_mt = self.mysqldb().query(TblComponentMaintenance).filter(
            TblComponentMaintenance.comp_id == cid).first()
        if comp_mt is None:
            msg.append(u"维护记录不存在, 请返回列表页面查看,record id={}".format(cid))

        if msg:
            return self.render('bug/compmtedit.html', message=msg, users=get_user_list(self),
                               projects=get_project_list(self))
        else:
            comp_mt.comp_describe = comp_describe
            comp_mt.comp_type = comp_type
            comp_mt.comp_new = comp_new
            comp_mt.comp_status = comp_status
            comp_mt.comp_belong_to = comp_belong_to
            comp_mt.comment = comment
            comp_mt.comp_reason = comp_reason
            comp_mt.comp_solution = comp_solution
            comp_mt.modify_time = datetime.now()
            comp_mt.create_time = datetime.now()
            comp_mt.user_belong_to = user_belong_to

            try:
                self.mysqldb().commit()
                return self.redirect('/compmt/list')
            except Exception as e:
                self.mysqldb().rollback()
                msg.append(e)
                return self.render('bug/compmtedit.html', message=msg, users=get_user_list(self),
                                   projects=get_project_list(self))
예제 #2
0
 def get(self):
     weblog.info("%s.", self._request_summary())
     # return self.render('bug/bugtrackadd.html')
     return self.render('bug/bugtrackadd.html',
                        message="",
                        users=get_user_list(self),
                        projects=get_project_list(self))
예제 #3
0
 def get(self):
     weblog.info("%s.", self._request_summary())
     task = dict()
     task['progress'] = 45
     self.render("project/task.html", message="", projects=get_project_list(self),
                 users=get_user_list(self), task=task)
     pass
예제 #4
0
 def get(self, bid):
     weblog.info("%s.", self._request_summary())
     # return self.render('bug/bugtracklist.html', bugtracks=get_bugtrack_list(self, belongid, compid))
     return self.render('bug/bugtrackedit.html',
                        message="",
                        users=get_user_list(self),
                        projects=get_project_list(self),
                        bug=get_bugtrack_by_id(self, bid))
예제 #5
0
 def get(self):
     belongid = self.get_argument("belongid", None)
     compid = self.get_argument("compid", None)
     blevel = self.get_argument("blevel", None)
     weblog.info("%s.", self._request_summary())
     return self.render('bug/bugtracklist.html',
                        bugtracks=get_bugtrack_list(self, belongid, compid,
                                                    blevel),
                        users=get_user_list(self),
                        projects=get_project_list(self))
예제 #6
0
 def get(self, cid):
     weblog.info("%s.", self._request_summary())
     comp_mt = self.mysqldb().query(TblComponentMaintenance).filter_by(comp_id=cid).first()
     comp_mt.comp_status = -1
     try:
         self.mysqldb().commit()
     except Exception as e:
         weblog.error("delete component maintenance id={} error. {}".format(cid, e))
         self.mysqldb().rollback()
     return self.render('bug/compmtlist.html', bugs=get_compmt_list(self),
                        users=get_user_list(self), projects=get_project_list(self))
예제 #7
0
 def post(self):
     weblog.info("%s.", self._request_summary())
     cur_login_name = self.get_secure_cookie('user_account')
     # 用户是否存在
     bug_name = self.get_argument("bug_name",None)
     project_id = self.get_argument("project_name", None)
     bug_find_by = self.get_argument("bug_find_by", None)
     bug_user_done = self.get_argument("bug_user_done", None)
     bug_describe = self.get_argument("bug_describe", None)
     bug_solution = self.get_argument("bug_solution", None)
     bug_date_plan = self.get_argument("bug_date_plan", None)
     bug_date_done = self.get_argument("bug_date_done", None)
     msg = []
     if bug_name is None:
         msg.append(u"bug名称不能为空")
     if bug_solution is None or bug_describe is None:
         msg.append(u"bug描述或解决方案为空")
     if bug_date_plan is None or bug_date_done is None:
         msg.append(u"bug计划日期或解决日期为空")
     if msg:
         return self.render('bug/bugadd.html', message=msg, users=get_user_list(self),
                            projects=get_project_list(self))
     try:
         new_bug = TblBugList()
         new_bug.bug_name = bug_name
         new_bug.bug_find_by = bug_find_by
         new_bug.bug_user_done = bug_user_done
         new_bug.bug_describe = bug_describe
         new_bug.bug_solution = bug_solution
         new_bug.bug_date_plan = bug_date_plan
         new_bug.bug_date_done = bug_date_done
         new_bug.bug_project_id = project_id
         self.mysqldb().add(new_bug)
         self.mysqldb().commit()
         return self.render('bug/buglist.html', bugs=get_bug_list(self))
     except:
         weblog.exception("Add new bug error!")
         self.mysqldb().rollback()
         return self.render('bug/bugadd.html', message=msg, users=get_user_list(self),
                            projects=get_project_list(self))
예제 #8
0
 def get(self):
     self.render("project/projectlist.html",
                 projects=get_project_list(self))
     pass
예제 #9
0
    def post(self, bid):
        weblog.info("%s.", self._request_summary())
        weblog.info("%s.", self._request_summary())
        bug_date_receive = self.get_argument("bug_date_receive", None)
        bug_find_by = int(self.get_argument("bug_find_by", 0))
        bug_component = int(self.get_argument("bug_component", 0))
        component_belong = int(self.get_argument("component_belong", 0))
        component_community = self.get_argument("component_community", None)
        bug_project_id = int(self.get_argument("bug_project_id", 0))
        # project_name = Column(String(1024), nullable=False, comment=u"项目名称")
        project_version = self.get_argument("project_version", None)
        bug_describe = self.get_argument("bug_describe", None)
        bug_level = int(self.get_argument("bug_level", 0))
        bug_reason = self.get_argument("bug_reason", None)
        bug_solution = self.get_argument("bug_solution", None)
        bug_progress = self.get_argument("bug_progress", None)
        bug_date_plan = self.get_argument("bug_date_plan", None)
        bug_date_done = self.get_argument("bug_date_done", None)
        bug_user_done = int(self.get_argument("bug_user_done", 0))
        bug_version = self.get_argument("bug_version", None)
        msg = []
        if bug_date_receive is None:
            msg.append(u"接收日期不能为空")
        if project_version is None:
            msg.append(u"模块所属版本不能为空")
        if bug_date_plan is None or bug_date_done is None:
            msg.append(u"计划日期或解决日期不能为空")
        if bug_version is None:
            msg.append(u"合入版本不能为空")
        bug_track = self.mysqldb().query(TblBugTrack).filter(
            TblBugTrack.bug_id == bid).first()
        if bug_track is None:
            msg.append(u"获取问题单为空,问题单id={}".format(bid))
        if msg:
            return self.render('bug/bugtrackadd.html',
                               message=msg,
                               users=get_user_list(self),
                               projects=get_project_list(self))
        bug_track.bug_date_receive = bug_date_receive
        bug_track.bug_find_by = bug_find_by
        bug_track.bug_component = bug_component
        bug_track.component_belong = component_belong
        bug_track.component_community = component_community
        bug_track.bug_project_id = bug_project_id
        bug_track.project_version = project_version
        bug_track.bug_describe = bug_describe
        bug_track.bug_level = bug_level
        bug_track.bug_reason = bug_reason
        bug_track.bug_solution = bug_solution
        bug_track.bug_progress = bug_progress
        bug_track.bug_date_plan = bug_date_plan
        bug_track.bug_date_done = bug_date_done
        bug_track.bug_user_done = bug_user_done
        bug_track.bug_version = bug_version

        try:
            self.mysqldb().commit()
            return self.redirect("/bugtrack/list")
        except Exception as e:
            msg.append(e)
            return self.render('bug/bugtrackedit.html',
                               message=msg,
                               users=get_user_list(self),
                               projects=get_project_list(self))
예제 #10
0
 def get(self):
     weblog.info("%s.", self._request_summary())
     compmts = get_compmt_list(self)
     return self.render('bug/compmtlist.html', bugs=compmts,
                        users=get_user_list(self), projects=get_project_list(self))
예제 #11
0
 def get(self, cid):
     weblog.info("%s.", self._request_summary())
     return self.render('bug/compmtedit.html', message="", users=get_user_list(self)
                        , projects=get_project_list(self), bug=get_compmt_by_id(self, cid))