Exemplo n.º 1
0
 def contribution_detail(self, request):
     req_date = request.get_form_var("date")
     if req_date:
         try:
             req_date = dateutil.parser.parse(req_date).astimezone(dateutil.tz.tzoffset("EST", 8 * 3600))
         except ValueError as e:
             return ""
         contributions = UserContributions.get_by_date(self.name, req_date)
         owned = contributions.get("owned_tickets")
         commented = contributions.get("commented_tickets")
         owned_tickets = filter(None, [Ticket.get(id_) for id_ in owned])
         commented_tickets = filter(None, [Ticket.get(comment[0]) for comment in commented])
         return st("people_contribution_detail.html", **locals())
     return ""
Exemplo n.º 2
0
 def contribution_detail(self, request):
     req_date = request.get_form_var('date')
     if req_date:
         try:
             req_date = dateutil.parser.parse(req_date).astimezone(
                 dateutil.tz.tzoffset('EST', 8 * 3600))
         except ValueError as e:
             return ""
         contributions = UserContributions.get_by_date(self.name, req_date)
         owned = contributions.get('owned_tickets')
         commented = contributions.get('commented_tickets')
         owned_tickets = filter(None, [Ticket.get(id_) for id_ in owned])
         commented_tickets = filter(
             None, [Ticket.get(comment[0]) for comment in commented])
         return st('people_contribution_detail.html', **locals())
     return ""
Exemplo n.º 3
0
 def contribution_detail(self, request):
     req_date = request.get_form_var('date')
     if not req_date:
         return {"error": "No datetime"}
     try:
         req_date = dateutil.parser.parse(req_date).astimezone(
             dateutil.tz.tzoffset('EST', 8 * 3600))
     except ValueError:
         return {"error": "Invalid date"}
     contributions = UserContributions.get_by_date(self.user.name, req_date)
     owned = contributions.get('owned_tickets')
     commented = contributions.get('commented_tickets')
     pullreqs = [Ticket.get(id_).as_dict() for id_ in owned]
     participated = [
         Ticket.get(comment[0]).as_dict() for comment in commented
     ]
     return {"pull requests": pullreqs, "participated": participated}
Exemplo n.º 4
0
 def contribution_detail(self, request):
     req_date = request.get_form_var('date')
     if not req_date:
         return {"error": "No datetime"}
     try:
         req_date = dateutil.parser.parse(req_date).astimezone(
             dateutil.tz.tzoffset('EST', 8 * 3600))
     except ValueError:
         return {"error": "Invalid date"}
     contributions = UserContributions.get_by_date(self.user.name, req_date)
     owned = contributions.get('owned_tickets')
     commented = contributions.get('commented_tickets')
     pullreqs = [Ticket.get(id_).as_dict() for id_ in owned]
     participated = [Ticket.get(comment[0]).as_dict()
                     for comment in commented]
     return {"pull requests": pullreqs,
             "participated": participated}