diff --git a/account/cbase_members.py b/account/cbase_members.py index 23e5489..e6426cb 100644 --- a/account/cbase_members.py +++ b/account/cbase_members.py @@ -173,13 +173,11 @@ class MemberValues(object): if (result_data == []): break else: - ## here you don't have to append to a list - ## you could do whatever you want with the individual entry - ## The appending to list is just for illustration. if result_type == ldap.RES_SEARCH_ENTRY: result_set.append(result_data) - userlist = [x[0][1]['uid'][0] for x in result_set] + # list comprehension to get a list of user tupels in the format ("nickname", "nickname (real name)") + userlist = [(x[0][1]['uid'][0], '%s (%s)' % (x[0][1]['uid'][0], x[0][1]['cn'][0])) for x in result_set] return sorted(userlist) except: return [] \ No newline at end of file diff --git a/account/forms.py b/account/forms.py index cc6f9ea..f70cdc5 100644 --- a/account/forms.py +++ b/account/forms.py @@ -137,7 +137,7 @@ class AdminForm(forms.Form): def __init__(self, *args, **kwargs): self._request = kwargs.pop('request', None) self._users = kwargs.pop('users', []) - choices = [(x, x) for x in self._users] + choices = [x for x in self._users] choices.insert(0, ('', 'Select username ...')) super(AdminForm, self).__init__(*args, **kwargs) self.fields.insert(0, 'username', forms.ChoiceField(choices=choices, diff --git a/account/templates/home.html b/account/templates/home.html index 4ca70f8..77de400 100644 --- a/account/templates/home.html +++ b/account/templates/home.html @@ -47,7 +47,7 @@ {% blocktrans %}The external e-mail address is used by the board of c-base to reach you in cases where your c-base address (see above) is not working. To change your - externe e-mail address please contact the c-base board + external e-mail address please contact the c-base board (vorstand@c-base.org).{% endblocktrans %}