diff --git a/boards/views/authors.py b/boards/views/authors.py --- a/boards/views/authors.py +++ b/boards/views/authors.py @@ -3,6 +3,7 @@ from django.shortcuts import render from boards.authors import authors from boards.views.base import BaseBoardView + class AuthorsView(BaseBoardView): def get(self, request): diff --git a/boards/views/ban.py b/boards/views/ban.py --- a/boards/views/ban.py +++ b/boards/views/ban.py @@ -1,8 +1,10 @@ from django.db import transaction +from django.shortcuts import get_object_or_404 from boards.views.base import BaseBoardView from boards.models import Post, Ban + class BanUserView(BaseBoardView): @transaction.atomic diff --git a/boards/views/delete_post.py b/boards/views/delete_post.py --- a/boards/views/delete_post.py +++ b/boards/views/delete_post.py @@ -5,6 +5,7 @@ from boards.views.base import BaseBoardV from boards.views.redirect_next_mixin import RedirectNextMixin from boards.models import Post + class DeletePostView(BaseBoardView, RedirectNextMixin): @transaction.atomic diff --git a/boards/views/not_found.py b/boards/views/not_found.py --- a/boards/views/not_found.py +++ b/boards/views/not_found.py @@ -2,10 +2,11 @@ from django.shortcuts import render from boards.views.base import BaseBoardView + class NotFoundView(BaseBoardView): - ''' + """ Page 404 (not found) - ''' + """ def get(self, request): context = self.get_context_data(request=request) diff --git a/boards/views/redirect_next_mixin.py b/boards/views/redirect_next_mixin.py --- a/boards/views/redirect_next_mixin.py +++ b/boards/views/redirect_next_mixin.py @@ -1,6 +1,7 @@ from django.shortcuts import redirect from django.http import HttpResponseRedirect + class RedirectNextMixin: def redirect_to_next(self, request): diff --git a/boards/views/settings.py b/boards/views/settings.py --- a/boards/views/settings.py +++ b/boards/views/settings.py @@ -5,6 +5,7 @@ from boards.views.base import BaseBoardV from boards.forms import SettingsForm, ModeratorSettingsForm, PlainErrorList from boards.views import SETTING_MODERATE + class SettingsView(BaseBoardView): def get(self, request): @@ -15,9 +16,10 @@ class SettingsView(BaseBoardView): selected_theme = context['theme'] if is_moderator: - form = ModeratorSettingsForm(initial={'theme': selected_theme, - 'moderate': context['moderator']}, - error_class=PlainErrorList) + form = ModeratorSettingsForm(initial={ + 'theme': selected_theme, + 'moderate': context['moderator'] + }, error_class=PlainErrorList) else: form = SettingsForm(initial={'theme': selected_theme}, error_class=PlainErrorList) diff --git a/boards/views/thread.py b/boards/views/thread.py --- a/boards/views/thread.py +++ b/boards/views/thread.py @@ -116,6 +116,6 @@ class ThreadView(BaseBoardView, PostMixi if html_response: if opening_post: - return redirect(reverse('thread', - kwargs={'post_id': thread_to_show}) + '#' - + str(post.id)) + return redirect(reverse( + 'thread', + kwargs={'post_id': thread_to_show}) + '#' + str(post.id))