Why do I get AttributeError: 'NoneType' object has no attribute 'something'?

前端 未结 10 2022
长情又很酷
长情又很酷 2020-11-21 13:36

I keep getting an error that says

AttributeError: \'NoneType\' object has no attribute \'something\'
10条回答
  •  长情又很酷
    2020-11-21 13:58

    You can get this error with you have commented out HTML in a Flask application. Here the value for qual.date_expiry is None:

       
    

    Delete the line or fix it up:

    {% if qual.date_attained != None %} {{ qual.date_attained.date() }} {% endif %} 
    

提交回复
热议问题