From 14d24f496e56a92d674a1f3cab2b2a5dc7db11fe Mon Sep 17 00:00:00 2001 From: Michele Comitini Date: Tue, 15 May 2012 22:38:43 +0200 Subject: [PATCH 1/2] Simplify the https check logic using request.is_https which is smarter. --- applications/welcome/controllers/appadmin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/applications/welcome/controllers/appadmin.py b/applications/welcome/controllers/appadmin.py index 7a2ce1f7..70f66878 100644 --- a/applications/welcome/controllers/appadmin.py +++ b/applications/welcome/controllers/appadmin.py @@ -25,8 +25,7 @@ try: except: hosts = (http_host, ) -if request.env.http_x_forwarded_for or request.env.wsgi_url_scheme\ - in ['https', 'HTTPS']: +if request.env.http_x_forwarded_for or request.is_https: session.secure() elif (remote_addr not in hosts) and (remote_addr != "127.0.0.1"): raise HTTP(200, T('appadmin is disabled because insecure channel')) From 29b8979bdb4ca962cd5e7321753cbdb2f62618e2 Mon Sep 17 00:00:00 2001 From: Michele Comitini Date: Wed, 6 Jun 2012 13:07:54 +0200 Subject: [PATCH 2/2] White space after \ at eol removed. --- gluon/dal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gluon/dal.py b/gluon/dal.py index 09fbb747..05aa72df 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -4127,7 +4127,7 @@ class GoogleDatastoreAdapter(NoSQLAdapter): def select(self,query,fields,attributes): (items, tablename, fields) = self.select_raw(query,fields,attributes) # self.db['_lastsql'] = self._select(query,fields,attributes) - rows = [[(t=='id' and item.key().id_or_name()) or \ + rows = [[(t=='id' and item.key().id_or_name()) or \ (t=='nativeRef' and item) or getattr(item, t) \ for t in fields] for item in items] colnames = ['%s.%s' % (tablename, t) for t in fields]