openknowledge-archive / dpr-api

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

[m] change SQL-Alchemy first call to one #316

Closed subhankarb closed 7 years ago

subhankarb commented 7 years ago

Previously we were using auth0. There email id was not unique. We were elying 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.

That is why changing SQL-alchemy's first method call to one. Also add Exception handling, as if there is no data SQL-alchemy throws, NoResultFound exception.

Resolves : #310