Skip to content

Commit

Permalink
type casting lockValue
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Damico committed May 27, 2021
1 parent 730310f commit f34c053
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions LDlink/RegisterAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def setUserLock(email, lockValue):
mongo_port = config['database']['mongo_port']

out_json = {
"message": "Email user (" + email + ")'s token access lock has been set to " + lockValue
"message": "Email user (" + email + ")'s lock has been set to " + str(lockValue)
}
if env == 'local':
mongo_host = api_mongo_addr
Expand All @@ -257,7 +257,7 @@ def setUserLock(email, lockValue):
client = MongoClient('mongodb://' + mongo_username + ':' + mongo_password + '@' + mongo_host + '/LDLink', mongo_port)
db = client["LDLink"]
users = db.api_users
users.find_one_and_update({"email": email}, { "$set": {"locked": lockValue}})
users.find_one_and_update({"email": email}, { "$set": {"locked": int(lockValue)}})

return out_json

Expand Down Expand Up @@ -381,7 +381,7 @@ def checkBlocked(token):
else:
return False

# check if token is locked (1=locked, 0=not locked). returns true (1) if token is locked
# check if token is locked (1=locked, 0=not locked, -1=never locked). returns true (1) if token is locked
def checkLocked(token):
with open('config.yml', 'r') as c:
config = yaml.load(c)
Expand Down

0 comments on commit f34c053

Please sign in to comment.