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:
parent
e5e2384998
commit
fdd43e2490
6 changed files with 21 additions and 14 deletions
|
@ -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)
|
||||
|
|
Reference in a new issue