'Options' object has no attribute 'module_name'

Issue #1 new
Vishal Kumar Mishra
created an issue

When I click on a topic (created with Django Admin), it gives following error:

'Options' object has no attribute 'module_name'

I am using Django 1.11

Comments (2)

  1. Vishal Kumar Mishra reporter

    In get_context_object_list_name method of TopicQuestionsMixin doing this fixes the issue.

        def get_context_object_list_name(self, object_list):
            """
            Get the name of the object_list to be used in the context.
            """
            if self.context_object_list_name:
                return self.context_object_list_name
            elif hasattr(object_list, 'model'):
                # Get model_name or lowercase module_name for older versions
                # of Django
                model_name = getattr(
                    object_list.model._meta,
                    'model_name'
                )
                return '%s_list' % model_name
            else:
    
  2. Log in to comment