##// END OF EJS Templates
Always show main thread for post in post link. Prefetch thread replies' thread and threads
Always show main thread for post in post link. Prefetch thread replies' thread and threads

File last commit:

r899:27671c1c default
r984:c2eb220a default
Show More
middlewares.py
28 lines | 670 B | text/x-python | PythonLexer
neko259
Added ban middleware. Now banned user's won't cause load to the server.
r210 from django.shortcuts import redirect
neko259
Implemented search over posts. Moved get_user and get_theme to utils module. Use context processors instead of creating context in the base view. Removed unused imports in some modules
r690 from boards import utils
neko259
Added ban middleware. Now banned user's won't cause load to the server.
r210 from boards.models import Ban
neko259
Added a middleware to remove spaces between tags in HTML code
r444
RESPONSE_CONTENT_TYPE = 'Content-Type'
TYPE_HTML = 'text/html'
neko259
Added ban middleware. Now banned user's won't cause load to the server.
r210
class BanMiddleware:
neko259
Added a middleware to remove spaces between tags in HTML code
r444 """
This is run before showing the thread. Banned users don't need to see
anything
"""
neko259
Added ban middleware. Now banned user's won't cause load to the server.
r210
neko259
Small code cleanups
r721 def __init__(self):
pass
neko259
Added ban middleware. Now banned user's won't cause load to the server.
r210 def process_view(self, request, view_func, view_args, view_kwargs):
neko259
Added centrifuge (websocket) support for thread autoupdate. Only websocket version is supported for now
r853 if request.path != '/banned/':
neko259
Added ban middleware. Now banned user's won't cause load to the server.
r210 ip = utils.get_client_ip(request)
neko259
Added ban reasons. Added write-only bans.
r340 bans = Ban.objects.filter(ip=ip)
neko259
Added ban middleware. Now banned user's won't cause load to the server.
r210
neko259
Added ban reasons. Added write-only bans.
r340 if bans.exists():
ban = bans[0]
if not ban.can_read:
neko259
Rewriting views to class-based
r542 return redirect('banned')