Jelajahi Sumber

Fixes issue #54: use field.remote_field instead of field.related_model to ensure we have a model instance

Diego Navarro Mellén 9 tahun lalu
induk
melakukan
2779e28fa6
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      jet/filters.py

+ 2 - 2
jet/filters.py

@@ -13,8 +13,8 @@ class RelatedFieldAjaxListFilter(RelatedFieldListFilter):
         return True
 
     def field_choices(self, field, request, model_admin):
-        app_label = field.related_model._meta.app_label
-        model_name = field.related_model._meta.object_name
+        app_label = field.remote_field.model._meta.app_label
+        model_name = field.remote_field.model._meta.object_name
 
         self.ajax_attrs = format_html('{}', flatatt({
             'data-app-label': app_label,