Make name_changes_disabled() work with no argument.

This commit is contained in:
Vishnu Ks 2016-06-11 03:51:23 +05:30 committed by Tim Abbott
parent e109b50152
commit 01c9bb2d5e
1 changed files with 3 additions and 1 deletions

View File

@ -74,7 +74,9 @@ from zerver.lib.rest import rest_dispatch as _rest_dispatch
rest_dispatch = csrf_exempt((lambda request, *args, **kwargs: _rest_dispatch(request, globals(), *args, **kwargs)))
def name_changes_disabled(realm):
# type: (Realm) -> bool
# type: (Optional[Realm]) -> bool
if realm is None:
return settings.NAME_CHANGES_DISABLED
return settings.NAME_CHANGES_DISABLED or realm.name_changes_disabled
@require_post