Sfoglia il codice sorgente

Adjust error message for invalid postcode for country

master
David Winterbottom 12 anni fa
parent
commit
c8bdfc0fff
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3
    3
      oscar/apps/address/abstract_models.py

+ 3
- 3
oscar/apps/address/abstract_models.py Vedi File

@@ -274,9 +274,9 @@ class AbstractAddress(models.Model):
274 274
 
275 275
             # Validate postcode against regext for the country if available
276 276
             if regex and not re.match(regex, postcode):
277
-                msg = _("'%(postcode)s' is not a valid postcode for %(country)s") % {
278
-                    'postcode': self.postcode,
279
-                    'country': self.country.printable_name}
277
+                msg = _("The postcode '%(postcode)s' is not valid "
278
+                        "for the country selected") % {
279
+                            'postcode': self.postcode}
280 280
                 raise exceptions.ValidationError(msg)
281 281
 
282 282
     def _update_search_text(self):

Loading…
Annulla
Salva