From b9f93918c851765d172fdaeb49f19cf2ec59f156 Mon Sep 17 00:00:00 2001 From: Adam Charnock Date: Thu, 3 Dec 2015 12:50:00 +0000 Subject: [PATCH] Simplifying get_filterset_kwargs() as ImproperlyConfigured cannot be raised --- graphene/contrib/django/resolvers.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/graphene/contrib/django/resolvers.py b/graphene/contrib/django/resolvers.py index 21408b32..7960106b 100644 --- a/graphene/contrib/django/resolvers.py +++ b/graphene/contrib/django/resolvers.py @@ -73,18 +73,8 @@ class FilterConnectionResolver(BaseQuerySetConnectionResolver): return filterset_class(**kwargs) def get_filterset_kwargs(self, filterset_class): - kwargs = {'data': self.args or None} - try: - kwargs.update({ - 'queryset': self.get_manager(), - }) - except ImproperlyConfigured: - # ignore the error here if the filterset has a model defined - # to acquire a queryset from - if filterset_class._meta.model is None: - msg = ("'%s' does not define a 'model' and the resolver '%s' " - "does not return a valid queryset from 'get_queryset'. " - "You must fix one of them.") - args = (filterset_class.__name__, self.__class__.__name__) - raise ImproperlyConfigured(msg % args) + kwargs = { + 'data': self.args or None, + 'queryset': self.get_manager() + } return kwargs