I'm trying to return the confirmed
BooleanField of a user in the UserTable
model (so I can deny access to some routes later) with this code:
models.py
class UserTable(UserMixin, Model):
email = CharField(unique=True)
password = CharField()
confirmed = BooleanField()
class Meta:
database = db
app.py
@app.route('/isconfirmed/<email>')
def isconfirmed(email):
return models.UserTable.get(models.UserTable.email == email).confirmed
When I try this however I receive: TypeError: 'bool' object is not callable
I've tried accessing email
and password
with:
return models.UserTable.get(models.UserTable.email == email).email
etc. and it works just fine. I don't understand why it can't return a True or False from a BooleanField???
I'm using Postgres as my database if that is of any relevance / help.
Any help is appreciated greatly!!!