0001-manager-select-default-ou-in-users-table-45338.patch
src/authentic2/manager/forms.py | ||
---|---|---|
576 | 576 | |
577 | 577 |
def __init__(self, *args, **kwargs): |
578 | 578 |
self.minimum_chars = kwargs.pop('minimum_chars', 0) |
579 |
initial = kwargs.setdefault('initial', {}) |
|
580 |
initial['ou'] = str(get_default_ou().pk) |
|
579 | 581 |
super(UserSearchForm, self).__init__(*args, **kwargs) |
580 | 582 | |
581 | 583 |
def not_enough_chars(self): |
tests/test_user_manager.py | ||
---|---|---|
335 | 335 |
response = login(app, admin, '/manage/users/') |
336 | 336 |
assert response.pyquery('td.username') |
337 | 337 | |
338 |
assert response.pyquery('select#id_search-ou option:selected').val() == str(get_default_ou().pk) |
|
339 |
assert admin.username in response.text |
|
340 |
assert not user_ou1.username in response.text |
|
341 | ||
338 | 342 |
# hide all usernames, from specific and general view |
339 | 343 |
OU.objects.update(show_username=False) |
340 | 344 |
has_show_username.cache.clear() |
341 |
- |