Converted webapp portion to python 3.5. Resolves #32

This commit is contained in:
Jeremy Zhang
2017-08-19 00:33:50 +00:00
parent 15011078c8
commit fb8cfe3abc
13 changed files with 46 additions and 53 deletions

View File

@ -45,14 +45,14 @@ def user_has_permission(permission, index):
return bool((int(permission) >> index) & 1)
def get_user_guilds():
cache = get_keyvalproperty("OAUTH/USERGUILDS/"+make_user_cache_key())
cache = get_keyvalproperty("OAUTH/USERGUILDS/"+str(make_user_cache_key()))
if cache:
return cache
req = discordrest_from_user("/users/@me/guilds")
if req.status_code != 200:
abort(req.status_code)
req = json.dumps(req.json())
set_keyvalproperty("OAUTH/USERGUILDS/"+make_user_cache_key(), req, 250)
set_keyvalproperty("OAUTH/USERGUILDS/"+str(make_user_cache_key()), req, 250)
return req
def get_user_managed_servers():