We are getting user email while generating jwt token. While calling db we are using .first() method.
Previously we were using auth0. There email id was not unique. We were relying on auth0 user id. But now we are using github for authentication. We changed the DB model to
email = db.Column(db.TEXT, unique=True, index=True)
So email supposed to be unique.
tasks
[x] Change sql-alchemy method from .first() to .one()
[x] Change sql-alchemy method from .first() to .one()
Change sql-alchemy call from
.first()
to.one()
Context
We are getting user email while generating jwt token. While calling db we are using
.first()
method. Previously we were using auth0. There email id was not unique. We were relying on auth0 user id. But now we are using github for authentication. We changed the DB model toemail = db.Column(db.TEXT, unique=True, index=True)
So email supposed to be unique.tasks
.first()
to.one()
.first()
to.one()