Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
Allow query_id and query_secret to be cleaned and empty.
Browse files Browse the repository at this point in the history
Removed the web/var/nimbus.sqlite database from being revisioned.
  • Loading branch information
clemesha-ooi authored and timf committed Jan 28, 2010
1 parent 3428aa9 commit 56733f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web/src/python/nimbusweb/portal/nimbus/forms.py
Expand Up @@ -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

Expand All @@ -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)
Empty file removed web/var/nimbus.sqlite
Empty file.

0 comments on commit 56733f0

Please sign in to comment.