banned.py
17 lines
| 492 B
| text/x-python
|
PythonLexer
neko259
|
r542 | 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""" | ||||
neko259
|
r918 | params = dict() | ||
neko259
|
r542 | |||
ban = get_object_or_404(Ban, ip=utils.get_client_ip(request)) | ||||
neko259
|
r918 | params['ban_reason'] = ban.reason | ||
neko259
|
r872 | |||
neko259
|
r918 | return render(request, 'boards/staticpages/banned.html', params) | ||