mirror of https://github.com/zulip/zulip.git
Send customer29.invalid signups to customer29.invalid too
Eventually there should be a database table or something where we can configure this for each realm. (imported from commit 5f3e6823f420e113da8ff8c521cc706175299fa4)
This commit is contained in:
parent
8b5e492c76
commit
b8d56433f0
|
@ -54,15 +54,15 @@ def get_stream(stream_name, realm):
|
|||
except Stream.DoesNotExist:
|
||||
return None
|
||||
|
||||
def notify_new_user(user_profile, internal=False):
|
||||
def send_signup_message(sender, signups_stream, user_profile, internal=False):
|
||||
if internal:
|
||||
# When this is done using manage.py vs. the web interface
|
||||
internal_blurb = " **INTERNAL SIGNUP** "
|
||||
else:
|
||||
internal_blurb = " "
|
||||
|
||||
internal_send_message("humbug+signups@humbughq.com",
|
||||
Recipient.STREAM, "signups", user_profile.realm.domain,
|
||||
internal_send_message(sender,
|
||||
Recipient.STREAM, signups_stream, user_profile.realm.domain,
|
||||
"%s <`%s`> just signed up for Humbug!%s(total: **%i**)" % (
|
||||
user_profile.full_name,
|
||||
user_profile.user.email,
|
||||
|
@ -72,6 +72,15 @@ def notify_new_user(user_profile, internal=False):
|
|||
)
|
||||
)
|
||||
|
||||
def notify_new_user(user_profile, internal=False):
|
||||
send_signup_message("humbug+signups@humbughq.com", "signups", user_profile, internal)
|
||||
|
||||
if user_profile.realm.domain == "customer29.invalid":
|
||||
try:
|
||||
send_signup_message("bot1@customer29.invalid", "signups", user_profile, internal)
|
||||
except UserProfile.DoesNotExist:
|
||||
pass
|
||||
|
||||
class PrincipalError(JsonableError):
|
||||
def __init__(self, principal):
|
||||
self.principal = principal
|
||||
|
|
Loading…
Reference in New Issue