Your print statement shows True or False , because you are returning a string representation of the boolean in the str override. In other words, you print the lines "True" or "False". The actual logical field confirmed is the field in your model. You must change your condition:
if not confirmed.confirmed: ...
By the way, it is better to use the get_object_or_404 method instead of get() to return a 404 page instead of a server error if EmailConfirmed objects were not found:
from django.shortcuts import get_object_or_404 ... def awaiting_email_confirmation(request): confirmed = get_object_or_404(EmailConfirmed, user=request.user) if not confirmed.confirmed: ...
source share