import datetime

from django.db import models


class ActiveOfferManager(models.Manager):
    """
    For searching/creating ACTIVE offers only.
    """
    def get_query_set(self):
        today = datetime.date.today()
        return super(ActiveOfferManager, self).get_query_set().filter(
            start_date__lte=today, end_date__gt=today)

import datetime

from django.db import models


class ActiveOfferManager(models.Manager):
    """
    For searching/creating offers within their date range
    """
    def get_query_set(self):
        today = datetime.date.today()
        return super(ActiveOfferManager, self).get_query_set().filter(
            start_date__lte=today, end_date__gte=today)

Fix queryset filtering for active offers
Fix queryset filtering for active offers

  import datetime
  
  from django.db import models
  
  
  class ActiveOfferManager(models.Manager):
      """
-     For searching/creating ACTIVE offers only.
+     For searching/creating offers within their date range
      """
      def get_query_set(self):
          today = datetime.date.today()
          return super(ActiveOfferManager, self).get_query_set().filter(
-             start_date__lte=today, end_date__gt=today)
+             start_date__lte=today, end_date__gte=today)
  
Fix queryset filtering for active offers
## Code Before:
import datetime

from django.db import models


class ActiveOfferManager(models.Manager):
    """
    For searching/creating ACTIVE offers only.
    """
    def get_query_set(self):
        today = datetime.date.today()
        return super(ActiveOfferManager, self).get_query_set().filter(
            start_date__lte=today, end_date__gt=today)

## Instruction:
Fix queryset filtering for active offers
## Code After:
import datetime

from django.db import models


class ActiveOfferManager(models.Manager):
    """
    For searching/creating offers within their date range
    """
    def get_query_set(self):
        today = datetime.date.today()
        return super(ActiveOfferManager, self).get_query_set().filter(
            start_date__lte=today, end_date__gte=today)
