Skip to content

Commit

Permalink
Fix groupsummary to not internal server error
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaher authored and Archaeopteryx committed Jul 6, 2023
1 parent c422f7c commit 1a34d16
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions treeherder/webapp/api/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@ def list(self, request):
if 'enddate' in request.query_params:
enddate = request.query_params['enddate']

if (
not enddate
or not re.match(r'^[0-9]{4}-[0-9]{2}-[0-9]{2}$', enddate)
or ((enddate - startdate).days > 1)
):
if not enddate or not re.match(r'^[0-9]{4}-[0-9]{2}-[0-9]{2}$', enddate):
enddate = startdate + datetime.timedelta(days=1)
else:
enddate = datetime.datetime.strptime(enddate, "%Y-%m-%d")

if (enddate - startdate).days > 1:
enddate = startdate + datetime.timedelta(days=1)

q = (
Job.objects.filter(
push__time__gte=str(startdate.date()), push__time__lte=str(enddate.date())
Expand Down

0 comments on commit 1a34d16

Please sign in to comment.