openknowledge-archive / dpr-api

DEPRECATED - Data Package Registry API and Frontend
http://frictionlessdata.io/
MIT License
7 stars 6 forks source link

Remove ambiguous db call for user email #310

Closed subhankarb closed 7 years ago

subhankarb commented 7 years ago

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 to email = db.Column(db.TEXT, unique=True, index=True) So email supposed to be unique.

tasks

zelima commented 7 years ago

FIXED