Make do_create_realm aware of restricted_to_domain.

(imported from commit bee8d79cd5f5d4165e2a573eb3a91123857be6cd)
This commit is contained in:
Jessica McKellar
2013-05-31 10:58:35 -04:00
parent 67a25614df
commit 048a53c1ce

View File

@@ -693,12 +693,14 @@ def do_change_full_name(user_profile, full_name, log=True):
'user': user_profile.email, 'user': user_profile.email,
'full_name': full_name}) 'full_name': full_name})
def do_create_realm(domain): def do_create_realm(domain, restricted_to_domain=True):
realm, created = Realm.objects.get_or_create(domain=domain) realm, created = Realm.objects.get_or_create(
domain=domain, restricted_to_domain=restricted_to_domain)
if created: if created:
# Log the event # Log the event
log_event({"type": "realm_created", log_event({"type": "realm_created",
"domain": domain}) "domain": domain,
"restricted_to_domain": restricted_to_domain})
internal_send_message("humbug+signups@humbughq.com", "stream", internal_send_message("humbug+signups@humbughq.com", "stream",
"signups", domain, "Signups enabled.") "signups", domain, "Signups enabled.")