Change API calls that expect non-robots to explicitly filter

Before this change, we'd filter in the UI but calls to the API could allow robots accounts where we only expect real users
This commit is contained in:
Joseph Schorr 2015-05-26 17:47:33 -04:00
parent e5e2384998
commit fdd43e2490
6 changed files with 21 additions and 14 deletions

View file

@ -642,6 +642,13 @@ def find_user_by_email(email):
return None
def get_nonrobot_user(username):
try:
return User.get(User.username == username, User.organization == False, User.robot == False)
except User.DoesNotExist:
return None
def get_user(username):
try:
return User.get(User.username == username, User.organization == False)