From c1d14a35eea7dc12353b067315bdc24e61c6402a Mon Sep 17 00:00:00 2001 From: mdipierro Date: Thu, 4 Oct 2012 11:53:04 -0500 Subject: [PATCH] fixed preblem with db singledon serialization in tickets --- VERSION | 2 +- gluon/dal.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index e00188f4..75dbec0f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.0.9 (2012-10-04 10:44:23) dev +Version 2.0.9 (2012-10-04 11:52:53) dev diff --git a/gluon/dal.py b/gluon/dal.py index 7f71544c..bd67b1f5 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -241,6 +241,7 @@ REGEX_SQUARE_BRACKETS = re.compile('^.+\[.+\]$') REGEX_STORE_PATTERN = re.compile('\.(?P\w{1,5})$') REGEX_QUOTES = re.compile("'[^']*'") REGEX_ALPHANUMERIC = re.compile('^[0-9a-zA-Z]\w*$') +REGEX_PASSWORD = re.compile('\://([^:@]*)\:') # list of drivers will be built on the fly # and lists only what is available @@ -430,6 +431,9 @@ def pluralize(singular, rules=PLURALIZE_RULES): plural = re_search.search(singular) and re_sub.sub(replace, singular) if plural: return plural +def hide_password(uri): + return REGEX_PASSWORD.sub('://******:',uri) + def OR(a,b): return a|b @@ -7125,7 +7129,10 @@ def index(): __delitem__ = object.__delattr__ def __repr__(self): - return '' % self._uri + if hasattr(self,'_uri'): + return '' % hide_password(str(self._uri)) + else: + return '' % self._singleton_code def smart_query(self,fields,text): return Set(self, smart_query(fields,text))