##// END OF EJS Templates
Minor style fixes to view classes. Fixed ban view
neko259 -
r561:2045aa89 1.7-dev
parent child Browse files
Show More
@@ -3,6 +3,7 b' from django.shortcuts import render'
3 3 from boards.authors import authors
4 4 from boards.views.base import BaseBoardView
5 5
6
6 7 class AuthorsView(BaseBoardView):
7 8
8 9 def get(self, request):
@@ -1,8 +1,10 b''
1 1 from django.db import transaction
2 from django.shortcuts import get_object_or_404
2 3
3 4 from boards.views.base import BaseBoardView
4 5 from boards.models import Post, Ban
5 6
7
6 8 class BanUserView(BaseBoardView):
7 9
8 10 @transaction.atomic
@@ -5,6 +5,7 b' from boards.views.base import BaseBoardV'
5 5 from boards.views.redirect_next_mixin import RedirectNextMixin
6 6 from boards.models import Post
7 7
8
8 9 class DeletePostView(BaseBoardView, RedirectNextMixin):
9 10
10 11 @transaction.atomic
@@ -2,10 +2,11 b' from django.shortcuts import render'
2 2
3 3 from boards.views.base import BaseBoardView
4 4
5
5 6 class NotFoundView(BaseBoardView):
6 '''
7 """
7 8 Page 404 (not found)
8 '''
9 """
9 10
10 11 def get(self, request):
11 12 context = self.get_context_data(request=request)
@@ -1,6 +1,7 b''
1 1 from django.shortcuts import redirect
2 2 from django.http import HttpResponseRedirect
3 3
4
4 5 class RedirectNextMixin:
5 6
6 7 def redirect_to_next(self, request):
@@ -5,6 +5,7 b' from boards.views.base import BaseBoardV'
5 5 from boards.forms import SettingsForm, ModeratorSettingsForm, PlainErrorList
6 6 from boards.views import SETTING_MODERATE
7 7
8
8 9 class SettingsView(BaseBoardView):
9 10
10 11 def get(self, request):
@@ -15,9 +16,10 b' class SettingsView(BaseBoardView):'
15 16 selected_theme = context['theme']
16 17
17 18 if is_moderator:
18 form = ModeratorSettingsForm(initial={'theme': selected_theme,
19 'moderate': context['moderator']},
20 error_class=PlainErrorList)
19 form = ModeratorSettingsForm(initial={
20 'theme': selected_theme,
21 'moderate': context['moderator']
22 }, error_class=PlainErrorList)
21 23 else:
22 24 form = SettingsForm(initial={'theme': selected_theme},
23 25 error_class=PlainErrorList)
@@ -116,6 +116,6 b' class ThreadView(BaseBoardView, PostMixi'
116 116
117 117 if html_response:
118 118 if opening_post:
119 return redirect(reverse('thread',
120 kwargs={'post_id': thread_to_show}) + '#'
121 + str(post.id))
119 return redirect(reverse(
120 'thread',
121 kwargs={'post_id': thread_to_show}) + '#' + str(post.id))
General Comments 0
You need to be logged in to leave comments. Login now