mirror of https://github.com/zulip/zulip.git
docs: Fix get_user function in caching documentation.
This commit fixes the get_user function code to be same as that of the original function in models.py.
This commit is contained in:
parent
592d0e2794
commit
c843600d76
|
@ -68,8 +68,9 @@ def user_profile_cache_key(email: str, realm: "Realm") -> str:
|
||||||
|
|
||||||
@cache_with_key(user_profile_cache_key, timeout=3600 * 24 * 7)
|
@cache_with_key(user_profile_cache_key, timeout=3600 * 24 * 7)
|
||||||
def get_user(email: str, realm: Realm) -> UserProfile:
|
def get_user(email: str, realm: Realm) -> UserProfile:
|
||||||
return UserProfile.objects.select_related().get(
|
return UserProfile.objects.select_related("realm", "bot_owner").get(
|
||||||
email__iexact=email.strip(), realm=realm)
|
email__iexact=email.strip(), realm=realm
|
||||||
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
This decorator implements a pretty classic caching paradigm:
|
This decorator implements a pretty classic caching paradigm:
|
||||||
|
|
Loading…
Reference in New Issue