##// END OF EJS Templates
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
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

File last commit:

r545:9c27ae2e 1.7-dev
r690:a8dffe47 1.8-dev
Show More
banned.py
16 lines | 526 B | text/x-python | PythonLexer
from django.shortcuts import get_object_or_404, render
from boards import utils
from boards.models import Ban
from boards.views.base import BaseBoardView
class BannedView(BaseBoardView):
def get(self, request):
"""Show the page that notifies that user is banned"""
context = self.get_context_data(request=request)
ban = get_object_or_404(Ban, ip=utils.get_client_ip(request))
context['ban_reason'] = ban.reason
return render(request, 'boards/staticpages/banned.html', context)