Esempio n. 1
0
 def open(self, operator):
     opened_time = datetime.now()
     store.execute("update codedouban_ticket set closed=null where id=%s",
                   (self.id, ))
     store.commit()
     mc.delete(MCKEY_TICKET % self.id)
     self.close_by = None
     self.add_participant(operator)
     TicketNode.add_open(self.id, operator, opened_time)
Esempio n. 2
0
 def open(self, operator):
     opened_time = datetime.now()
     store.execute("update codedouban_ticket set closed=null where id=%s",
                   (self.id,))
     store.commit()
     mc.delete(MCKEY_TICKET % self.id)
     self.close_by = None
     self.add_participant(operator)
     TicketNode.add_open(self.id, operator, opened_time)
Esempio n. 3
0
 def add_codereview(self, from_sha, to_sha, old_path, new_path, from_oid,
                    to_oid, old_linenum, new_linenum, author, content):
     new_path = new_path or old_path
     self.add_participant(author)
     codereview = PullLineComment.add(self.id, from_sha, to_sha, old_path,
                                      new_path, from_oid, to_oid,
                                      old_linenum, new_linenum, author,
                                      content)
     TicketNode.add_codereview(codereview)
     return codereview
Esempio n. 4
0
 def add_codereview(self, from_sha, to_sha,
                    old_path, new_path, from_oid, to_oid,
                    old_linenum, new_linenum,
                    author, content):
     new_path = new_path or old_path
     self.add_participant(author)
     codereview = PullLineComment.add(self.id, from_sha, to_sha,
                                      old_path, new_path, from_oid,
                                      to_oid, old_linenum, new_linenum,
                                      author, content)
     TicketNode.add_codereview(codereview)
     return codereview
Esempio n. 5
0
    def close(self, operator):
        closed_time = datetime.now()
        store.execute("update codedouban_ticket set closed=%s where id=%s",
                      (closed_time, self.id))
        store.commit()
        mc.delete(MCKEY_TICKET % self.id)
        self.close_by = operator

        for paticipant in self.participants:
            # FIXME better interface
            from models.user import UserPullRequests
            UserPullRequests(paticipant).remove_participated(self.id)
            UserPullRequests(paticipant).remove_invited(self.id)

        self.add_participant(operator)
        TicketNode.add_close(self.id, operator, closed_time)
Esempio n. 6
0
    def close(self, operator):
        closed_time = datetime.now()
        store.execute("update codedouban_ticket set closed=%s where id=%s",
                      (closed_time, self.id))
        store.commit()
        mc.delete(MCKEY_TICKET % self.id)
        self.close_by = operator

        for paticipant in self.participants:
            # FIXME better interface
            from vilya.models.user import UserPullRequests
            UserPullRequests(paticipant).remove_participated(self.id)
            UserPullRequests(paticipant).remove_invited(self.id)

        self.add_participant(operator)
        TicketNode.add_close(self.id, operator, closed_time)
Esempio n. 7
0
 def delete(self):
     node = TicketNode.get_by_codereview(self)
     if node:
         node.delete()
     bdb.delete(BDB_TICKET_LINECOMMENT_CONTENT_KEY % self.id)
     n = store.execute("delete from codedouban_ticket_codereview "
                       "where id=%s", (self.id,))
     if n:
         store.commit()
         return True
Esempio n. 8
0
 def delete(self):
     node = TicketNode.get_by_codereview(self)
     if node:
         node.delete()
     bdb.delete(BDB_TICKET_LINECOMMENT_CONTENT_KEY % self.id)
     n = store.execute(
         "delete from codedouban_ticket_codereview "
         "where id=%s", (self.id, ))
     if n:
         store.commit()
         return True
Esempio n. 9
0
 def get_nodes(self):
     return TicketNode.gets_by_ticket_id(self.id)
Esempio n. 10
0
 def get_nodes(self):
     return TicketNode.gets_by_ticket_id(self.id)