From 462b9c80c055c4e118f8faea2c1d4ef9dbf9e702 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 24 Oct 2018 17:01:34 -0700 Subject: [PATCH] bots: Add basic documentation for duplicate bot names feature. --- zerver/lib/users.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zerver/lib/users.py b/zerver/lib/users.py index cfd5aaed1e..7ff53ce046 100644 --- a/zerver/lib/users.py +++ b/zerver/lib/users.py @@ -23,6 +23,10 @@ def check_full_name(full_name_raw: str) -> str: raise JsonableError(_("Invalid characters in name!")) return full_name +# NOTE: We don't try to absolutely prevent 2 bots from having the same +# name (e.g. you can get there by reactivating a deactivated bot after +# making a new bot with the same name). This is just a check designed +# to make it unlikely to happen by accident. def check_bot_name_available(realm_id: int, full_name: str) -> None: dup_exists = UserProfile.objects.filter( realm_id=realm_id,