Author: ianb
Date: 2006-05-26 10:02:37 -0600 (Fri, 26 May 2006)
New Revision: 1794

Modified:
   FormEncode/trunk/formencode/validators.py
Log:
Patch for CC validation, fixing case where ccCode starts with 0, from Dennis 
Muhlestein

Modified: FormEncode/trunk/formencode/validators.py
===================================================================
--- FormEncode/trunk/formencode/validators.py   2006-05-23 12:13:58 UTC (rev 
1793)
+++ FormEncode/trunk/formencode/validators.py   2006-05-26 16:02:37 UTC (rev 
1794)
@@ -2358,13 +2358,13 @@
         ccCode = str(field_dict[self.cc_code_field]).strip()
 
         try:
-            ccCode = int(ccCode)
+            int(ccCode)
         except ValueError:
             return {self.cc_code_field: self.message('notANumber', state)}
 
         length = self._cardInfo[ccType]
         validLength = False
-        if len(str(ccCode)) == length:
+        if len(ccCode) == length:
             validLength = True
         if not validLength:
             return {self.cc_code_field: self.message('badLength', state)}



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
FormEncode-CVS mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/formencode-cvs

Reply via email to