mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
models: Add optional realm_id argument to get_system_bot.
This commit is contained in:
committed by
Tim Abbott
parent
c2e038ea2f
commit
d45f3eecaa
@@ -499,7 +499,7 @@ def user_profile_delivery_email_cache_key(delivery_email: str, realm: "Realm") -
|
||||
return f"user_profile_by_delivery_email:{make_safe_digest(delivery_email.strip())}:{realm.id}"
|
||||
|
||||
|
||||
def bot_profile_cache_key(email: str) -> str:
|
||||
def bot_profile_cache_key(email: str, realm_id: Optional[int] = None) -> str:
|
||||
return f"bot_profile:{make_safe_digest(email.strip())}"
|
||||
|
||||
|
||||
|
||||
@@ -3084,7 +3084,7 @@ def get_user_including_cross_realm(email: str, realm: Optional[Realm] = None) ->
|
||||
|
||||
|
||||
@cache_with_key(bot_profile_cache_key, timeout=3600 * 24 * 7)
|
||||
def get_system_bot(email: str) -> UserProfile:
|
||||
def get_system_bot(email: str, realm_id: Optional[int] = None) -> UserProfile:
|
||||
return UserProfile.objects.select_related().get(email__iexact=email.strip())
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user