diff --git a/fieldset_forms.py b/fieldset_forms.py
index bcfbafa..3f0c773 100644
--- a/fieldset_forms.py
+++ b/fieldset_forms.py
@@ -19,6 +19,7 @@
from django.forms import Form
from django.utils import safestring
from django.forms.forms import BoundField
+from django.forms.util import ErrorList
class FieldsetError(Exception):
pass
@@ -41,12 +42,14 @@
else:
self.layout = [["All"]]
self.layout[0][1:]=(self.fields.keys())
- #raise Exception(self.layout)#debug
def as_div(self):
"""Render the form as a set of
s."""
output = ""
- # first, create the fieldsets
+ #Adding Errors
+ try: output += str(self.errors["NON_FIELD_ERRORS"])
+ except: pass
+ #create the fieldsets
for index in range(len(self.layout)):
output += self.create_fieldset(self.layout[index])
return safestring.mark_safe(output)
diff --git a/forms.py b/forms.py
index 94558c3..98279d8 100644
--- a/forms.py
+++ b/forms.py
@@ -116,7 +116,6 @@
label = _('Inital list owner address'),
error_messages = {
'required': _("Please enter the list owner's email address."),
- 'invalid': _('Please enter a valid email adress.')
},
required = True)
list_type = forms.ChoiceField(
@@ -137,22 +136,24 @@
widget = forms.CheckboxSelectMultiple(),
choices = languages,
required = False)
-
+
description = forms.CharField(
label = _('Description'),
required = True)
- web_host = forms.ChoiceField()
+ mail_host = forms.ChoiceField()
def __init__(self,domain_choices, *args, **kwargs):
super(ListNew, self).__init__(*args, **kwargs)
- self.fields["web_host"] = forms.ChoiceField(
+ self.fields["mail_host"] = forms.ChoiceField(
widget = forms.Select(),
label = _('Mail Host'),
required = True,
choices = domain_choices,
- error_messages = {'required': _("Choose an existing Domain."),}
+ error_messages = {'required': _("Choose an existing Domain."),
+ 'invalid':"ERROR-todo_forms.py" }#todo
)
+
def clean_listname(self):
try:
validate_email(self.cleaned_data['listname']+'@example.net')
@@ -168,7 +169,7 @@
the list should be the wished name of the fieldset, the following
the fields that should be included in the fieldset.
"""
- layout = [["List Details", "listname", "web_host", "list_owner", "description", "list_type"],
+ layout = [["List Details", "listname", "mail_host", "list_owner", "description", "list_type"],
["Available Languages", "languages"]]
class ListSubscribe(forms.Form):
diff --git a/templates/mailman-django/lists/new.html b/templates/mailman-django/lists/new.html
index cfa9b91..e8cc479 100644
--- a/templates/mailman-django/lists/new.html
+++ b/templates/mailman-django/lists/new.html
@@ -8,9 +8,7 @@
{% trans "Logout" %}