Fix 'lookup_field' on ModelSerializer. Closes #1944.

This commit is contained in:
Tom Christie 2014-10-15 09:24:49 +01:00
parent 826b5a8897
commit e272a36c9b

View File

@ -680,7 +680,7 @@ class ModelSerializer(Serializer):
PendingDeprecationWarning,
stacklevel=3
)
kwargs = extra_kwargs.get(field_name, {})
kwargs = extra_kwargs.get(api_settings.URL_FIELD_NAME, {})
kwargs['view_name'] = view_name
extra_kwargs[api_settings.URL_FIELD_NAME] = kwargs
@ -692,7 +692,7 @@ class ModelSerializer(Serializer):
PendingDeprecationWarning,
stacklevel=3
)
kwargs = extra_kwargs.get(field_name, {})
kwargs = extra_kwargs.get(api_settings.URL_FIELD_NAME, {})
kwargs['lookup_field'] = lookup_field
extra_kwargs[api_settings.URL_FIELD_NAME] = kwargs