|
@@ -14,6 +14,7 @@ from coin.mixins import CoinLdapSyncMixin
|
|
|
from coin import utils
|
|
|
from django.contrib.auth.signals import user_logged_in
|
|
|
from django.conf import settings
|
|
|
+from django.core.validators import RegexValidator
|
|
|
|
|
|
|
|
|
class Member(CoinLdapSyncMixin, models.Model):
|
|
@@ -53,7 +54,9 @@ class Member(CoinLdapSyncMixin, models.Model):
|
|
|
# TODO: use a django module that provides an address model? (would
|
|
|
# support more countries and address types)
|
|
|
address = models.TextField(verbose_name=u'Adresse')
|
|
|
- postal_code = models.CharField(max_length=15,
|
|
|
+ postal_code = models.CharField(max_length=5,
|
|
|
+ validators=[RegexValidator(regex=r'^\d{5}$',
|
|
|
+ message=u'Code postal non valide.')],
|
|
|
verbose_name=u'Code postal')
|
|
|
city = models.CharField(max_length=200,
|
|
|
verbose_name=u'Commune')
|