diff pylons_app/model/forms.py @ 490:74b9bed279ae celery

fixed validation of user email in user creation, and editing on admin panel
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 20 Sep 2010 22:55:55 +0200
parents 460ad816820d
children 6d44d3862ec4
line wrap: on
line diff
--- a/pylons_app/model/forms.py	Mon Sep 20 22:47:20 2010 +0200
+++ b/pylons_app/model/forms.py	Mon Sep 20 22:55:55 2010 +0200
@@ -212,7 +212,7 @@
 def UniqSystemEmail(old_data):
     class _UniqSystemEmail(formencode.validators.FancyValidator):
         def to_python(self, value, state):
-            if old_data['email'] != value:
+            if old_data.get('email') != value:
                 sa = meta.Session
                 try:
                     user = sa.query(User).filter(User.email == value).scalar()