Skip to content

Commit

Permalink
Support ValueErrors for reporting errors in auth during profile creat…
Browse files Browse the repository at this point in the history
…e as well

Before this, we only checked for the other calls
  • Loading branch information
shankari committed Oct 16, 2017
1 parent 213bcc3 commit 1cea00e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions emission/net/api/cfc_webapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,17 @@ def getTrips(day):

@post('/profile/create')
def createUserProfile():
logging.debug("Called createUserProfile")
userEmail = enaa.__getEmail(request, skipAuth, auth_method)
logging.debug("userEmail = %s" % userEmail)
user = User.register(userEmail)
logging.debug("Looked up user = %s" % user)
logging.debug("Returning result %s" % {'uuid': str(user.uuid)})
return {'uuid': str(user.uuid)}
try:
logging.debug("Called createUserProfile")
userEmail = enaa.__getEmail(request, skipAuth, auth_method)
logging.debug("userEmail = %s" % userEmail)
user = User.register(userEmail)
logging.debug("Looked up user = %s" % user)
logging.debug("Returning result %s" % {'uuid': str(user.uuid)})
return {'uuid': str(user.uuid)}
except ValueError, e:
traceback.print_exc()
abort(403, e.message)

@post('/profile/update')
def updateUserProfile():
Expand Down

0 comments on commit 1cea00e

Please sign in to comment.