Browse Source

#728: cleanup misago.threads.moderation imports

Rafał Pitoń 8 years ago
parent
commit
e18c36cdd4

+ 1 - 2
misago/threads/moderation/__init__.py

@@ -1,4 +1,3 @@
-# flake8: noqa
-from .exceptions import *
+from .exceptions import ModerationError
 from .threads import *
 from .threads import *
 from .posts import *
 from .posts import *

+ 10 - 0
misago/threads/moderation/posts.py

@@ -5,6 +5,16 @@ from django.utils.translation import ugettext as _
 from .exceptions import ModerationError
 from .exceptions import ModerationError
 
 
 
 
+__all__ = [
+    'approve_post',
+    'protect_post',
+    'unprotect_post',
+    'unhide_post',
+    'hide_post',
+    'delete_post',
+]
+
+
 def approve_post(user, post):
 def approve_post(user, post):
     if post.is_unapproved:
     if post.is_unapproved:
         post.is_unapproved = False
         post.is_unapproved = False

+ 16 - 0
misago/threads/moderation/threads.py

@@ -5,6 +5,22 @@ from django.utils.translation import ugettext as _
 from misago.threads.events import record_event
 from misago.threads.events import record_event
 
 
 
 
+__all__ = [
+    'change_thread_title',
+    'pin_thread_globally',
+    'pin_thread_locally',
+    'unpin_thread',
+    'move_thread',
+    'merge_thread',
+    'approve_thread',
+    'open_thread',
+    'close_thread',
+    'unhide_thread',
+    'hide_thread',
+    'delete_thread',
+]
+
+
 @atomic
 @atomic
 def change_thread_title(request, thread, new_title):
 def change_thread_title(request, thread, new_title):
     if thread.title != new_title:
     if thread.title != new_title:

+ 1 - 2
misago/threads/tests/test_threadview.py

@@ -4,8 +4,7 @@ from misago.conf import settings
 from misago.threads import testutils
 from misago.threads import testutils
 from misago.threads.events import record_event
 from misago.threads.events import record_event
 from misago.threads.models import Post, Thread
 from misago.threads.models import Post, Thread
-from misago.threads.moderation import threads as threads_moderation
-from misago.threads.moderation.posts import hide_post
+from misago.threads.moderation import hide_post, threads as threads_moderation
 from misago.users.testutils import AuthenticatedUserTestCase
 from misago.users.testutils import AuthenticatedUserTestCase
 
 
 
 

+ 1 - 2
misago/users/api/users.py

@@ -17,8 +17,7 @@ from misago.categories.models import Category
 from misago.core.cache import cache
 from misago.core.cache import cache
 from misago.core.rest_permissions import IsAuthenticatedOrReadOnly
 from misago.core.rest_permissions import IsAuthenticatedOrReadOnly
 from misago.core.shortcuts import get_int_or_404
 from misago.core.shortcuts import get_int_or_404
-from misago.threads.moderation.posts import hide_post
-from misago.threads.moderation.threads import hide_thread
+from misago.threads.moderation import hide_post, hide_thread
 from misago.users.bans import get_user_ban
 from misago.users.bans import get_user_ban
 from misago.users.forms.options import ForumOptionsForm
 from misago.users.forms.options import ForumOptionsForm
 from misago.users.online.utils import get_user_status
 from misago.users.online.utils import get_user_status