Declare variable key in the get_user example (#26)
parent
f1ae855ad0
commit
40b5be2d9c
|
@ -1156,6 +1156,7 @@ def get_user(self, user_id):
|
||||||
if user is None:
|
if user is None:
|
||||||
user = db.query("SELECT * FROM users WHERE user_id = {0}", user_id)
|
user = db.query("SELECT * FROM users WHERE user_id = {0}", user_id)
|
||||||
if user is not None:
|
if user is not None:
|
||||||
|
key = "user.{0}".format(user_id)
|
||||||
cache.set(key, json.dumps(user))
|
cache.set(key, json.dumps(user))
|
||||||
return user
|
return user
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue