Commit f21f3dd5dcd6d92d9fb0a597ff9b9740fdf05723
1 parent
c3f16f94
Exists in
master
and in
39 other branches
Adding list description on user create form - closes #102
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
src/accounts/forms.py
| @@ -6,6 +6,7 @@ from django.utils.translation import ugettext_lazy as _ | @@ -6,6 +6,7 @@ from django.utils.translation import ugettext_lazy as _ | ||
| 6 | 6 | ||
| 7 | from conversejs.models import XMPPAccount | 7 | from conversejs.models import XMPPAccount |
| 8 | 8 | ||
| 9 | +from accounts.utils import mailman | ||
| 9 | from super_archives.models import MailingList | 10 | from super_archives.models import MailingList |
| 10 | from .utils.validators import validate_social_account | 11 | from .utils.validators import validate_social_account |
| 11 | 12 | ||
| @@ -68,7 +69,10 @@ class UserUpdateForm(UserForm): | @@ -68,7 +69,10 @@ class UserUpdateForm(UserForm): | ||
| 68 | 69 | ||
| 69 | 70 | ||
| 70 | class ListsForm(forms.Form): | 71 | class ListsForm(forms.Form): |
| 71 | - LISTS_NAMES = ((list.name, list.name) for list in MailingList.objects.all()) | 72 | + LISTS_NAMES = (( |
| 73 | + listname, u'{} ({})'.format(listname, description) | ||
| 74 | + ) for listname, description in mailman.all_lists(description=True)) | ||
| 75 | + | ||
| 72 | lists = forms.MultipleChoiceField(label=_(u'Mailing lists'), | 76 | lists = forms.MultipleChoiceField(label=_(u'Mailing lists'), |
| 73 | required=False, | 77 | required=False, |
| 74 | widget=forms.CheckboxSelectMultiple, | 78 | widget=forms.CheckboxSelectMultiple, |