Skip to content

Commit

Permalink
Merge pull request #221 from CityOfNewYork/hotfix/openrecords_v2_1-de…
Browse files Browse the repository at this point in the history
…ployment-fixes

Standardize Email Capitalization for User Queries
  • Loading branch information
zgary authored Sep 8, 2017
2 parents 0c889de + 49eb710 commit 2c8c4ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/auth/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ def find_user_by_email(email):
).first()
return user if user.agencies.all() else None
elif current_app.config['USE_OAUTH']:
from sqlalchemy import func
return Users.query.filter(
Users.email == email,
func.lower(Users.email) == email.lower(),
Users.auth_user_type.in_(user_type_auth.AGENCY_USER_TYPES)
).first()
return None
Expand Down

0 comments on commit 2c8c4ea

Please sign in to comment.