AttributeError : ‘NoneType’ object has no attribute ‘lower’

I installed django-comments-dab package and i have done steps like documents but recived this error:
AttributeError: ‘NoneType’ object has no attribute ‘lower’

how can i fix it?

def get_model_obj(app_name, model_name, model_id):
    content_type = ContentType.objects.get(app_label=app_name, model=model_name.lower(''))
    model_object = content_type.get_object_for_this_type(id=model_id)

    return model_object

  • 1

    Please include the Traceback error, as well as how you’re calling get_model_obj(). I suspect that model_name is None.

    – 

  • Does this answer your question? Why do I get AttributeError: ‘NoneType’ object has no attribute ‘something’?

    – 

  • no it’s our problem in django-comments-dab

    – 

Leave a Comment