Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mvdb/support record duplication #274

Closed
wants to merge 16 commits into from
Prev Previous commit
Next Next commit
use inspect.signature() directly
m-vdb committed Oct 16, 2018
commit 169a148837e09ac74233048c9db497a8e5219928
3 changes: 1 addition & 2 deletions algoliasearch_django/models.py
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@
import sys
from algoliasearch.helpers import AlgoliaException
from django.db.models.query_utils import DeferredAttribute
from django.utils.inspect import func_supports_parameter

from .settings import DEBUG

@@ -154,7 +153,7 @@ def __init__(self, model, client, settings):
# Check duplication_method
if self.duplication_method:
self.duplication_method = check_and_get_attr(model, self.duplication_method)
if not func_supports_parameter(self.duplication_method, 'raw_record'):
if 'raw_record' not in inspect.signature(self.duplication_method).parameters:
raise AlgoliaIndexError('{} doesnt accept a `raw_record` parameter.'.format(
self.duplication_method
))