Add organization description field to realm settings.

This adds an organization description field to the Realm model, as well as
an input field to the organization settings template. Added three tests.
Set the max length of the field to 100 characters.

Fixes #3962.
This commit is contained in:
Sarah Stringer
2017-03-18 19:19:44 +00:00
committed by Tim Abbott
parent 81f9de7cc8
commit aa880b0419
12 changed files with 114 additions and 3 deletions

View File

@@ -431,6 +431,18 @@ def do_set_realm_name(realm, name):
)
send_event(event, active_user_ids(realm))
def do_set_realm_description(realm, description):
# type: (Realm, Text) -> None
realm.description = description
realm.save(update_fields=['description'])
event = dict(
type='realm',
op='update',
property='description',
value=description,
)
send_event(event, active_user_ids(realm))
def do_set_realm_restricted_to_domain(realm, restricted):
# type: (Realm, bool) -> None
realm.restricted_to_domain = restricted