From 7633211e629493fd53f3f24762f34dc0ff46cfa4 Mon Sep 17 00:00:00 2001 From: Eric Price Date: Mon, 2 Jun 2008 23:45:44 -0400 Subject: [PATCH] Fix a couple more bugs svn path=/trunk/packages/sipb-xen-www/; revision=576 --- code/main.py | 4 ++-- code/validation.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/main.py b/code/main.py index 8a5c178..fdc2837 100755 --- a/code/main.py +++ b/code/main.py @@ -160,7 +160,7 @@ def create(username, state, fields): else: err = None state.clear() #Changed global state - d = getListDict(username) + d = getListDict(username, state) d['err'] = err if err: for field in fields.keys(): @@ -335,7 +335,7 @@ def command(username, state, fields): return templates.command(searchList=[d]) if back == 'list': state.clear() #Changed global state - d = getListDict(username) + d = getListDict(username, state) d['result'] = result return templates.list(searchList=[d]) elif back == 'info': diff --git a/code/validation.py b/code/validation.py index caa8ce2..7eb1b4f 100644 --- a/code/validation.py +++ b/code/validation.py @@ -241,7 +241,7 @@ def testOwner(user, owner, machine=None): return owner def testContact(user, contact, machine=None): - if contact in (None, machine.contact): + if contact is None or (machine is not None and contact == machine.contact): return None if not re.match("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$", contact, re.I): raise InvalidInput('contact', contact, "Not a valid email.") -- 1.7.9.5