Skip to content

Commit

Permalink
fix big in timermiddleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoxia committed Jul 26, 2015
1 parent 66bffec commit f9f8b76
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion search/timermiddleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def process_request(self, request):

def process_response(self, request, response):
if not hasattr(request, "_tm_start_time"):
return
return response

total = (time() - request._tm_start_time) * 1000

Expand Down
2 changes: 1 addition & 1 deletion ssbc/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
url(r'^hash/(.{40})$', web.views.hash),
url(r'^info/(.{40})$', web.views.hash_old),
url(r'^search/(.+?)/(\d*)$', web.views.search, name='list'),
url(r'^search/(.+?)$', web.views.search),
url(r'^search/(.*?)$', web.views.search),
url(r'^list/(.+?)/(\d*)$', web.views.search_old),
url(r'^howto/$', web.views.howto, name='howto'),
]
2 changes: 2 additions & 0 deletions web/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def hash(request, h):

@cache_page(1800)
def search(request, keyword=None, p=None):
if not keyword:
return redirect('/')
if politics.is_sensitive(keyword):
return redirect('/?' + urllib.urlencode({'notallow': keyword.encode('utf8')}))
d = {'keyword': keyword}
Expand Down

0 comments on commit f9f8b76

Please sign in to comment.