Unverified Commit 60c3c849 by CapsLock

[fix] bug in search feature : cannot search when not on default page

Signed-off-by: CapsLock <faimaison@legeox.net>
parent 271434ce
......@@ -83,12 +83,19 @@ def default(db):
domain_names = []
pictures = []
if get_host_name() == '':
if request.forms.get('searchTerms') is not None:
if get_host_name() == '' or request.forms.get('searchTerms') is not None or 'q' in request.params:
if get_host_name() != '':
redirect('%s?q=%s' % (get_root_url(), request.forms.get('searchTerms')))
if request.forms.get('searchTerms') is not None or 'q' in request.params:
if request.forms.get('searchTerms') is not None:
squery = request.forms.get('searchTerms')
else:
squery = request.params['q']
db.execute('select distinct on (name) *'
' from domain_names dn where name like %s'
' and name is not null and name <>\'\' ',
(('%%%s%%' % request.forms.get('searchTerms')),))
(('%%%s%%' % squery),))
else:
db.execute('select * from domain_names dn'
' where name is not null and name <>\'\' ')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment