I keep getting an error that says
AttributeError: \'NoneType\' object has no attribute \'something\'
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 %}