Ignore FullResultSet exception introduced in Django 4.2 As of version 4.2 Django added an exception during query generation when a query matches everything contained in a table. Since the models.usage_for_queryset function is meant to handle this case, this patch instead uses the exception to determine if extra criteria are required. This effectively replaces the if statement that determines if a "where" value was generated. The if statement is maintained along with the ImportError skip to keep compatibility with older Django versions.