prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Broken date handling in careeropportunity display date
  ## What kind of an issue is this?
  
  - [x] Bug report
  - [ ] Feature request
  
  
  ## What is the expected behaviour?
  A careeropportunity should be displayed from the start date.
  
  ## What is the current behaviour?
  If the start date is in the past, but sufficiently close to the current date, the careeropportunity is not displayed. Setting the start date to an earlier date fixes the problem.
  
  <!-- if this is a bug report -->
  
  
  ## How do you reproduce this problem? 
  
  Set start date to the middle of the night the day before the current day.
  Broken date handling in careeropportunity display date
  ## What kind of an issue is this?
  
  - [x] Bug report
  - [ ] Feature request
  
  
  ## What is the expected behaviour?
  A careeropportunity should be displayed from the start date.
  
  ## What is the current behaviour?
  If the start date is in the past, but sufficiently close to the current date, the careeropportunity is not displayed. Setting the start date to an earlier date fixes the problem.
  
  <!-- if this is a bug report -->
  
  
  ## How do you reproduce this problem? 
  
  Set start date to the middle of the night the day before the current day.
  
  </issue>
  <code>
  [start of apps/careeropportunity/views.py]
  1 # -*- coding: utf-8 -*-
  2 
  3 from django.shortcuts import render
  4 from django.utils import timezone
  5 # API v1
  6 from rest_framework import mixins, viewsets
  7 from rest_framework.pagination import PageNumberPagination
  8 from rest_framework.permissions import AllowAny
  9 
  10 from apps.careeropportunity.models import CareerOpportunity
  11 from apps.careeropportunity.serializers import CareerSerializer
  12 
  13 
  14 def index(request, id=None):
  15     return render(request, 'careeropportunity/index.html')
  16 
  17 
  18 class HundredItemsPaginator(PageNumberPagination):
  19     page_size = 100
  20 
  21 
  22 class CareerViewSet(viewsets.GenericViewSet, mixins.RetrieveModelMixin, mixins.ListModelMixin):
  23     """
  24     Viewset for Career serializer
  25     """
  26 
  27     queryset = CareerOpportunity.objects.filter(
  28         start__lte=timezone.now(),
  29         end__gte=timezone.now()
  30     ).order_by('-featured', '-start')
  31     serializer_class = CareerSerializer
  32     permission_classes = (AllowAny,)
  33     pagination_class = HundredItemsPaginator
  34
  [end of apps/careeropportunity/views.py]
  [start of apps/careeropportunity/urls.py]
  1 # -*- coding: utf-8 -*-
  2 
  3 from django.conf.urls import url
  4 
  5 from apps.api.utils import SharedAPIRootRouter
  6 from apps.careeropportunity import views
  7 
  8 urlpatterns = [
  9     url(r'^$', views.index, name='careeropportunity_index'),
  10     url(r'^(\d+)/$', views.index, name='careeropportunity_details'),
  11 ]
  12 
  13 # API v1
  14 router = SharedAPIRootRouter()
  15 router.register(r'career', views.CareerViewSet)
  16
  [end of apps/careeropportunity/urls.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/apps/careeropportunity/urls.py b/apps/careeropportunity/urls.py
  --- a/apps/careeropportunity/urls.py
  +++ b/apps/careeropportunity/urls.py
  @@ -12,4 +12,4 @@
   
   # API v1
   router = SharedAPIRootRouter()
  -router.register(r'career', views.CareerViewSet)
  +router.register(r'career', views.CareerViewSet, base_name='careeropportunity')
  diff --git a/apps/careeropportunity/views.py b/apps/careeropportunity/views.py
  --- a/apps/careeropportunity/views.py
  +++ b/apps/careeropportunity/views.py
  @@ -24,10 +24,12 @@
       Viewset for Career serializer
       """
   
  -    queryset = CareerOpportunity.objects.filter(
  -        start__lte=timezone.now(),
  -        end__gte=timezone.now()
  -    ).order_by('-featured', '-start')
       serializer_class = CareerSerializer
       permission_classes = (AllowAny,)
       pagination_class = HundredItemsPaginator
  +
  +    def get_queryset(self, *args, **kwargs):
  +        return CareerOpportunity.objects.filter(
  +            start__lte=timezone.now(),
  +            end__gte=timezone.now()
  +        ).order_by('-featured', '-start')
  
verification_info: {"golden_diff": "diff --git a/apps/careeropportunity/urls.py b/apps/careeropportunity/urls.py\n--- a/apps/careeropportunity/urls.py\n+++ b/apps/careeropportunity/urls.py\n@@ -12,4 +12,4 @@\n \n # API v1\n router = SharedAPIRootRouter()\n-router.register(r'career', views.CareerViewSet)\n+router.register(r'career', views.CareerViewSet, base_name='careeropportunity')\ndiff --git a/apps/careeropportunity/views.py b/apps/careeropportunity/views.py\n--- a/apps/careeropportunity/views.py\n+++ b/apps/careeropportunity/views.py\n@@ -24,10 +24,12 @@\n     Viewset for Career serializer\n     \"\"\"\n \n-    queryset = CareerOpportunity.objects.filter(\n-        start__lte=timezone.now(),\n-        end__gte=timezone.now()\n-    ).order_by('-featured', '-start')\n     serializer_class = CareerSerializer\n     permission_classes = (AllowAny,)\n     pagination_class = HundredItemsPaginator\n+\n+    def get_queryset(self, *args, **kwargs):\n+        return CareerOpportunity.objects.filter(\n+            start__lte=timezone.now(),\n+            end__gte=timezone.now()\n+        ).order_by('-featured', '-start')\n", "issue": "Broken date handling in careeropportunity display date\n## What kind of an issue is this?\r\n\r\n- [x] Bug report\r\n- [ ] Feature request\r\n\r\n\r\n## What is the expected behaviour?\r\nA careeropportunity should be displayed from the start date.\r\n\r\n## What is the current behaviour?\r\nIf the start date is in the past, but sufficiently close to the current date, the careeropportunity is not displayed. Setting the start date to an earlier date fixes the problem.\r\n\r\n<!-- if this is a bug report -->\r\n\r\n\r\n## How do you reproduce this problem? \r\n\r\nSet start date to the middle of the night the day before the current day.\nBroken date handling in careeropportunity display date\n## What kind of an issue is this?\r\n\r\n- [x] Bug report\r\n- [ ] Feature request\r\n\r\n\r\n## What is the expected behaviour?\r\nA careeropportunity should be displayed from the start date.\r\n\r\n## What is the current behaviour?\r\nIf the start date is in the past, but sufficiently close to the current date, the careeropportunity is not displayed. Setting the start date to an earlier date fixes the problem.\r\n\r\n<!-- if this is a bug report -->\r\n\r\n\r\n## How do you reproduce this problem? \r\n\r\nSet start date to the middle of the night the day before the current day.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\nfrom django.shortcuts import render\nfrom django.utils import timezone\n# API v1\nfrom rest_framework import mixins, viewsets\nfrom rest_framework.pagination import PageNumberPagination\nfrom rest_framework.permissions import AllowAny\n\nfrom apps.careeropportunity.models import CareerOpportunity\nfrom apps.careeropportunity.serializers import CareerSerializer\n\n\ndef index(request, id=None):\n    return render(request, 'careeropportunity/index.html')\n\n\nclass HundredItemsPaginator(PageNumberPagination):\n    page_size = 100\n\n\nclass CareerViewSet(viewsets.GenericViewSet, mixins.RetrieveModelMixin, mixins.ListModelMixin):\n    \"\"\"\n    Viewset for Career serializer\n    \"\"\"\n\n    queryset = CareerOpportunity.objects.filter(\n        start__lte=timezone.now(),\n        end__gte=timezone.now()\n    ).order_by('-featured', '-start')\n    serializer_class = CareerSerializer\n    permission_classes = (AllowAny,)\n    pagination_class = HundredItemsPaginator\n", "path": "apps/careeropportunity/views.py"}, {"content": "# -*- coding: utf-8 -*-\n\nfrom django.conf.urls import url\n\nfrom apps.api.utils import SharedAPIRootRouter\nfrom apps.careeropportunity import views\n\nurlpatterns = [\n    url(r'^$', views.index, name='careeropportunity_index'),\n    url(r'^(\\d+)/$', views.index, name='careeropportunity_details'),\n]\n\n# API v1\nrouter = SharedAPIRootRouter()\nrouter.register(r'career', views.CareerViewSet)\n", "path": "apps/careeropportunity/urls.py"}]}