-
- Downloads
updated listname error
updated the error apearing at the time of creating a new list, checks the listname_chars from the mailman core over REST, depends on two MRs, one in the mailman core and second in the mailmanclient.
... | ... | @@ -24,6 +24,7 @@ from django.core.validators import validate_email |
from django.utils.encoding import smart_text | ||
from django.utils.translation import ugettext_lazy as _ | ||
from django.utils.version import get_complete_version | ||
from django_mailman3.lib.mailman import get_mailman_client | ||
from django.contrib.sites.models import Site | ||
import re | ||
... | ... | @@ -176,7 +177,10 @@ class ListNew(forms.Form): |
# "before you will be able to create a list") | ||
def clean_listname(self): | ||
_valid_listname = re.compile('[-_.0-9a-z]', re.IGNORECASE) | ||
client = get_mailman_client() | ||
_listname_chars = client.configuration['mailman'].get('listname_chars') | ||
print (_listname_chars) | ||
_valid_listname = re.compile(_listname_chars, re.IGNORECASE) | ||
|
||
if len(_valid_listname.sub('', self.cleaned_data['listname']))>0: | ||
raise forms.ValidationError(_('List name must not contain spaces or anything other than letters, ' | ||
... | ... |