diff --git a/django/shortcuts/__init__.py b/django/shortcuts/__init__.py
index 1cece7c..eafdd0c
a
|
b
|
def get_list_or_404(klass, *args, **kwargs):
|
56 | 56 | arguments and keyword arguments are used in the filter() query. |
57 | 57 | """ |
58 | 58 | queryset = _get_queryset(klass) |
59 | | obj_list = list(queryset.filter(*args, **kwargs)) |
60 | | if not obj_list: |
| 59 | obj_list = queryset.filter(*args, **kwargs) |
| 60 | if obj_list.count() == 0: |
61 | 61 | raise Http404('No %s matches the given query.' % queryset.model._meta.object_name) |
62 | 62 | return obj_list |