Permalink
Browse files

Allow query_id and query_secret to be cleaned and empty.

Removed the web/var/nimbus.sqlite database from being revisioned.
  • Loading branch information...
1 parent c4f516b commit a8a610c4f7fc5161a86ab8ba225548549af1dd81 @clemesha-ooi clemesha-ooi committed Jan 27, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 web/src/python/nimbusweb/portal/nimbus/forms.py
  2. 0 web/var/nimbus.sqlite
@@ -21,13 +21,13 @@ class KEYS:
query_id = "query_id"
query_secret = "query_secret"
- def clean_common(self, name):
+ def clean_common(self, name, allow_empty=False):
"""Adds strip() to string validation.
The django cleaning functions accept extraneous spaces, even strings that are just spaces. (email validation does not)
"""
x = self.cleaned_data[name]
x = x.strip()
- if not x:
+ if (not x) and (not allow_empty):
raise forms.ValidationError("Must contain actual characters")
return x
@@ -41,7 +41,7 @@ def clean_lastname(self):
return self.clean_common(self.KEYS.lastname)
def clean_query_id(self):
- return self.clean_common(self.KEYS.query_id)
+ return self.clean_common(self.KEYS.query_id, allow_empty=True)
def clean_query_secret(self):
- return self.clean_common(self.KEYS.query_secret)
+ return self.clean_common(self.KEYS.query_secret, allow_empty=True)
View
No changes.

0 comments on commit a8a610c

Please sign in to comment.