prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Featured careeropprotunities are not featured
  The featured opportunities are not prioritized over other opportunities. 
  
  
  </issue>
  <code>
  [start of apps/careeropportunity/views.py]
  1 #-*- coding: utf-8 -*-
  2 from django.utils import timezone
  3 
  4 from datetime import datetime
  5 
  6 from django.conf import settings
  7 from django.shortcuts import render_to_response
  8 from django.shortcuts import get_object_or_404
  9 from django.template import RequestContext
  10 
  11 from apps.careeropportunity.models import CareerOpportunity
  12 
  13 
  14 def index(request):
  15     opportunities = CareerOpportunity.objects.filter(
  16     	start__lte=timezone.now(), end__gte=timezone.now()).order_by('featured', '-start')
  17     
  18     return render_to_response('careeropportunity/index.html', \
  19             {'opportunities': opportunities}, \
  20             context_instance=RequestContext(request))
  21 
  22 
  23 def details(request, opportunity_id):
  24     opportunity = get_object_or_404(CareerOpportunity, pk=opportunity_id)
  25 
  26     return render_to_response('careeropportunity/details.html', \
  27             {'opportunity': opportunity}, \
  28             context_instance=RequestContext(request))
  29
  [end of apps/careeropportunity/views.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/views.py b/apps/careeropportunity/views.py
  --- a/apps/careeropportunity/views.py
  +++ b/apps/careeropportunity/views.py
  @@ -13,7 +13,7 @@
   
   def index(request):
       opportunities = CareerOpportunity.objects.filter(
  -    	start__lte=timezone.now(), end__gte=timezone.now()).order_by('featured', '-start')
  +    	start__lte=timezone.now(), end__gte=timezone.now()).order_by('-featured', '-start')
       
       return render_to_response('careeropportunity/index.html', \
               {'opportunities': opportunities}, \
  
verification_info: {"golden_diff": "diff --git a/apps/careeropportunity/views.py b/apps/careeropportunity/views.py\n--- a/apps/careeropportunity/views.py\n+++ b/apps/careeropportunity/views.py\n@@ -13,7 +13,7 @@\n \n def index(request):\n     opportunities = CareerOpportunity.objects.filter(\n-    \tstart__lte=timezone.now(), end__gte=timezone.now()).order_by('featured', '-start')\n+    \tstart__lte=timezone.now(), end__gte=timezone.now()).order_by('-featured', '-start')\n     \n     return render_to_response('careeropportunity/index.html', \\\n             {'opportunities': opportunities}, \\\n", "issue": "Featured careeropprotunities are not featured\nThe featured opportunities are not prioritized over other opportunities. \n\n", "before_files": [{"content": "#-*- coding: utf-8 -*-\nfrom django.utils import timezone\n\nfrom datetime import datetime\n\nfrom django.conf import settings\nfrom django.shortcuts import render_to_response\nfrom django.shortcuts import get_object_or_404\nfrom django.template import RequestContext\n\nfrom apps.careeropportunity.models import CareerOpportunity\n\n\ndef index(request):\n    opportunities = CareerOpportunity.objects.filter(\n    \tstart__lte=timezone.now(), end__gte=timezone.now()).order_by('featured', '-start')\n    \n    return render_to_response('careeropportunity/index.html', \\\n            {'opportunities': opportunities}, \\\n            context_instance=RequestContext(request))\n\n\ndef details(request, opportunity_id):\n    opportunity = get_object_or_404(CareerOpportunity, pk=opportunity_id)\n\n    return render_to_response('careeropportunity/details.html', \\\n            {'opportunity': opportunity}, \\\n            context_instance=RequestContext(request))\n", "path": "apps/careeropportunity/views.py"}]}