Ver código fonte

[enh] preferences redirection

asciimoo 11 anos atrás
pai
commit
d2898b0818
1 arquivos alterados com 2 adições e 3 exclusões
  1. 2
    3
      searx/webapp.py

+ 2
- 3
searx/webapp.py Ver arquivo

22
     from sys import path
22
     from sys import path
23
     path.append(os.path.realpath(os.path.dirname(os.path.realpath(__file__))+'/../'))
23
     path.append(os.path.realpath(os.path.dirname(os.path.realpath(__file__))+'/../'))
24
 
24
 
25
-from flask import Flask, request, render_template, url_for, Response, make_response
25
+from flask import Flask, request, render_template, url_for, Response, make_response, redirect
26
 from searx.engines import search, categories, engines, get_engines_stats
26
 from searx.engines import search, categories, engines, get_engines_stats
27
 from searx import settings
27
 from searx import settings
28
 import json
28
 import json
151
                     continue
151
                     continue
152
                 selected_categories.append(category)
152
                 selected_categories.append(category)
153
         if selected_categories:
153
         if selected_categories:
154
-            template = render('preferences.html', selected_categories=selected_categories)
155
-            resp = make_response(template)
154
+            resp = make_response(redirect('/'))
156
             resp.set_cookie('categories', ','.join(selected_categories))
155
             resp.set_cookie('categories', ','.join(selected_categories))
157
             return resp
156
             return resp
158
     return render('preferences.html')
157
     return render('preferences.html')