From 005c9f41767f4627613cc82ca967966e29f5e77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20G=C3=B6tz?= Date: Fri, 5 Apr 2019 19:32:25 +0200 Subject: [PATCH] Show all Users on group creation --- account_manager/views/group_views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/account_manager/views/group_views.py b/account_manager/views/group_views.py index 5a841b4..3ab229f 100644 --- a/account_manager/views/group_views.py +++ b/account_manager/views/group_views.py @@ -3,7 +3,7 @@ from django.shortcuts import render, redirect from account_helper.models import Realm from account_manager.forms import AddLDAPGroupForm -from account_manager.models import LdapGroup +from account_manager.models import LdapGroup, LdapUser from account_manager.main_views import is_realm_admin @@ -29,6 +29,7 @@ def group_detail(request, realm_id, group_dn): @is_realm_admin def group_add(request, realm_id): realm_obj = Realm.objects.get(id=realm_id) + LdapUser.base_dn = LdapUser.ROOT_DN # if this is a POST request we need to process the form data if request.method == 'POST': # create a form instance and populate it with data from the request: @@ -55,7 +56,7 @@ def group_update(request, realm_id, group_dn): realm = Realm.objects.get(id=realm_id) LdapGroup.base_dn = f'ou=groups,{realm.ldap_base_dn}' group = LdapGroup.objects.get(dn=group_dn) - + LdapUser.base_dn = LdapUser.ROOT_DN if request.method == 'POST': # create a form instance and populate it with data from the request: form = AddLDAPGroupForm(request.POST)