Browse Source

Reorder imports with isort

rafalp 6 years ago
parent
commit
319a9a96b4
239 changed files with 168 additions and 412 deletions
  1. 3 11
      .isort.cfg
  2. 1 0
      misago/acl/apps.py
  3. 0 1
      misago/acl/migrations/0003_default_roles.py
  4. 0 1
      misago/acl/panels.py
  5. 0 1
      misago/acl/providers.py
  6. 1 1
      misago/acl/tests/test_roleadmin_views.py
  7. 0 1
      misago/admin/auth.py
  8. 2 2
      misago/admin/tests/test_admin_form_templatetags.py
  9. 0 1
      misago/admin/urls.py
  10. 0 1
      misago/admin/views/errorpages.py
  11. 1 3
      misago/admin/views/index.py
  12. 1 1
      misago/cache/tests/test_invalidating_caches.py
  13. 1 2
      misago/categories/forms.py
  14. 1 2
      misago/categories/migrations/0001_initial.py
  15. 0 1
      misago/categories/migrations/0002_default_categories.py
  16. 0 1
      misago/categories/migrations/0003_categories_roles.py
  17. 0 1
      misago/categories/migrations/0006_moderation_queue_roles.py
  18. 0 1
      misago/categories/migrations/0007_best_answers_roles.py
  19. 1 2
      misago/categories/models.py
  20. 1 3
      misago/categories/serializers.py
  21. 0 1
      misago/categories/signals.py
  22. 0 1
      misago/categories/urls/api.py
  23. 0 1
      misago/conf/migrations/0002_cache_version.py
  24. 0 1
      misago/conf/tests/test_dynamic_settings_middleware.py
  25. 0 1
      misago/conf/tests/test_getting_static_settings_values.py
  26. 1 3
      misago/core/apipatch.py
  27. 2 2
      misago/core/cache.py
  28. 1 1
      misago/core/errorpages.py
  29. 1 3
      misago/core/exceptionhandler.py
  30. 0 1
      misago/core/migrations/0002_basic_settings.py
  31. 0 1
      misago/core/momentjs.py
  32. 1 2
      misago/core/rest_permissions.py
  33. 1 2
      misago/core/shortcuts.py
  34. 1 2
      misago/core/slugify.py
  35. 0 1
      misago/core/templatetags/misago_batch.py
  36. 0 1
      misago/core/templatetags/misago_capture.py
  37. 0 1
      misago/core/templatetags/misago_json.py
  38. 0 1
      misago/core/templatetags/misago_pagetitle.py
  39. 0 1
      misago/core/templatetags/misago_shorthands.py
  40. 0 1
      misago/core/templatetags/misago_stringutils.py
  41. 0 1
      misago/core/testproject/urls.py
  42. 0 1
      misago/core/testproject/urlswitherrorhandlers.py
  43. 2 3
      misago/core/testproject/views.py
  44. 0 1
      misago/core/tests/test_checks.py
  45. 1 1
      misago/core/tests/test_errorpages.py
  46. 1 3
      misago/core/tests/test_exceptionhandler_middleware.py
  47. 0 1
      misago/core/tests/test_exceptionhandlers.py
  48. 0 1
      misago/core/tests/test_jsi18n.py
  49. 1 2
      misago/core/tests/test_pgpartialindex.py
  50. 1 2
      misago/core/tests/test_serializers.py
  51. 0 1
      misago/core/tests/test_templatetags.py
  52. 3 3
      misago/core/tests/test_utils.py
  53. 0 1
      misago/core/utils.py
  54. 0 1
      misago/faker/englishcorpus.py
  55. 1 2
      misago/faker/management/commands/createfakebans.py
  56. 1 2
      misago/faker/management/commands/createfakecategories.py
  57. 0 1
      misago/faker/management/commands/createfakefollowers.py
  58. 1 3
      misago/faker/management/commands/createfakethreads.py
  59. 1 3
      misago/faker/management/commands/createfakeusers.py
  60. 0 1
      misago/legal/api.py
  61. 0 1
      misago/legal/context_processors.py
  62. 0 1
      misago/legal/migrations/0001_initial.py
  63. 2 2
      misago/legal/migrations/0002_agreement_useragreement.py
  64. 0 1
      misago/legal/migrations/0003_create_agreements_from_settings.py
  65. 0 1
      misago/legal/models.py
  66. 0 1
      misago/legal/urls/api.py
  67. 0 1
      misago/legal/views/admin.py
  68. 1 3
      misago/markup/bbcode/blocks.py
  69. 0 1
      misago/markup/finalise.py
  70. 0 1
      misago/markup/md/shortimgs.py
  71. 0 1
      misago/markup/md/striketrough.py
  72. 0 2
      misago/markup/mentions.py
  73. 2 4
      misago/markup/parser.py
  74. 0 1
      misago/markup/templatetags/misago_editor.py
  75. 0 1
      misago/markup/urls.py
  76. 2 2
      misago/readtracker/migrations/0002_postread.py
  77. 1 2
      misago/readtracker/migrations/0003_migrate_reads_to_posts.py
  78. 1 2
      misago/readtracker/signals.py
  79. 1 1
      misago/readtracker/tests/test_categoriestracker.py
  80. 2 3
      misago/search/api.py
  81. 0 1
      misago/search/urls/api.py
  82. 0 1
      misago/threads/anonymize.py
  83. 2 4
      misago/threads/api/attachments.py
  84. 1 1
      misago/threads/api/pollvotecreateendpoint.py
  85. 2 4
      misago/threads/api/postendpoints/delete.py
  86. 1 2
      misago/threads/api/postendpoints/edits.py
  87. 1 2
      misago/threads/api/postendpoints/merge.py
  88. 1 2
      misago/threads/api/postendpoints/move.py
  89. 0 1
      misago/threads/api/postendpoints/patch_event.py
  90. 3 5
      misago/threads/api/postendpoints/patch_post.py
  91. 1 2
      misago/threads/api/postendpoints/split.py
  92. 1 2
      misago/threads/api/postingendpoint/attachments.py
  93. 1 2
      misago/threads/api/postingendpoint/category.py
  94. 0 1
      misago/threads/api/postingendpoint/floodprotection.py
  95. 3 4
      misago/threads/api/postingendpoint/participants.py
  96. 1 2
      misago/threads/api/postingendpoint/reply.py
  97. 0 1
      misago/threads/api/postingendpoint/subscribe.py
  98. 1 2
      misago/threads/api/threadendpoints/delete.py
  99. 1 2
      misago/threads/api/threadendpoints/editor.py
  100. 2 3
      misago/threads/api/threadendpoints/merge.py
  101. 3 4
      misago/threads/api/threadendpoints/patch.py
  102. 3 4
      misago/threads/api/threadpoll.py
  103. 4 5
      misago/threads/api/threadposts.py
  104. 4 5
      misago/threads/api/threads.py
  105. 0 1
      misago/threads/filtersearch.py
  106. 1 2
      misago/threads/mergeconflict.py
  107. 0 1
      misago/threads/migrations/0002_threads_settings.py
  108. 0 1
      misago/threads/migrations/0003_attachment_types.py
  109. 1 1
      misago/threads/migrations/0008_auto_20180310_2234.py
  110. 1 2
      misago/threads/models/attachment.py
  111. 1 1
      misago/threads/models/post.py
  112. 0 1
      misago/threads/moderation/posts.py
  113. 0 1
      misago/threads/moderation/threads.py
  114. 0 1
      misago/threads/participants.py
  115. 0 1
      misago/threads/permissions/attachments.py
  116. 2 2
      misago/threads/permissions/bestanswers.py
  117. 0 1
      misago/threads/permissions/polls.py
  118. 0 1
      misago/threads/permissions/privatethreads.py
  119. 2 2
      misago/threads/permissions/threads.py
  120. 0 1
      misago/threads/search.py
  121. 1 3
      misago/threads/serializers/attachment.py
  122. 0 1
      misago/threads/serializers/feed.py
  123. 3 4
      misago/threads/serializers/moderation.py
  124. 1 3
      misago/threads/serializers/poll.py
  125. 1 3
      misago/threads/serializers/pollvote.py
  126. 1 3
      misago/threads/serializers/post.py
  127. 1 3
      misago/threads/serializers/postedit.py
  128. 1 3
      misago/threads/serializers/postlike.py
  129. 1 3
      misago/threads/serializers/thread.py
  130. 0 1
      misago/threads/serializers/threadparticipant.py
  131. 0 1
      misago/threads/signals.py
  132. 0 1
      misago/threads/templatetags/misago_poststags.py
  133. 1 3
      misago/threads/tests/test_anonymize_data.py
  134. 1 2
      misago/threads/tests/test_attachments_api.py
  135. 1 2
      misago/threads/tests/test_delete_user_likes.py
  136. 0 1
      misago/threads/tests/test_gotoviews.py
  137. 1 3
      misago/threads/tests/test_mergeconflict.py
  138. 1 1
      misago/threads/tests/test_privatethread_patch_api.py
  139. 0 1
      misago/threads/tests/test_subscription_middleware.py
  140. 1 1
      misago/threads/tests/test_thread_patch_api.py
  141. 1 1
      misago/threads/tests/test_thread_postlikes_api.py
  142. 1 1
      misago/threads/tests/test_thread_postpatch_api.py
  143. 1 1
      misago/threads/tests/test_threads_api.py
  144. 1 1
      misago/threads/tests/test_threadview.py
  145. 0 1
      misago/threads/tests/test_treesmap.py
  146. 0 1
      misago/threads/urls/api.py
  147. 0 1
      misago/threads/viewmodels/category.py
  148. 0 1
      misago/threads/viewmodels/post.py
  149. 0 1
      misago/threads/viewmodels/posts.py
  150. 0 1
      misago/threads/viewmodels/thread.py
  151. 0 1
      misago/threads/views/attachment.py
  152. 0 1
      misago/urls.py
  153. 0 1
      misago/users/activepostersranking.py
  154. 0 1
      misago/users/admin.py
  155. 3 5
      misago/users/api/auth.py
  156. 1 2
      misago/users/api/captcha.py
  157. 2 4
      misago/users/api/mention.py
  158. 1 2
      misago/users/api/rest_permissions.py
  159. 2 3
      misago/users/api/userendpoints/avatar.py
  160. 1 2
      misago/users/api/userendpoints/changeemail.py
  161. 1 2
      misago/users/api/userendpoints/changepassword.py
  162. 2 3
      misago/users/api/userendpoints/create.py
  163. 1 3
      misago/users/api/userendpoints/editdetails.py
  164. 1 3
      misago/users/api/userendpoints/list.py
  165. 2 3
      misago/users/api/userendpoints/signature.py
  166. 2 3
      misago/users/api/userendpoints/username.py
  167. 2 4
      misago/users/api/usernamechanges.py
  168. 4 6
      misago/users/api/users.py
  169. 0 1
      misago/users/authbackends.py
  170. 1 3
      misago/users/avatars/dynamic.py
  171. 1 3
      misago/users/avatars/gallery.py
  172. 0 1
      misago/users/avatars/gravatar.py
  173. 1 2
      misago/users/avatars/store.py
  174. 1 2
      misago/users/avatars/uploaded.py
  175. 0 1
      misago/users/captcha.py
  176. 0 1
      misago/users/datadownloads/dataarchive.py
  177. 1 2
      misago/users/forms/admin.py
  178. 0 1
      misago/users/forms/auth.py
  179. 0 1
      misago/users/forms/register.py
  180. 1 0
      misago/users/management/commands/buildactivepostersranking.py
  181. 0 1
      misago/users/management/commands/createsuperuser.py
  182. 0 1
      misago/users/management/commands/deleteinactiveusers.py
  183. 1 3
      misago/users/management/commands/deletemarkedusers.py
  184. 1 1
      misago/users/management/commands/deleteprofilefield.py
  185. 0 1
      misago/users/management/commands/invalidatebans.py
  186. 0 1
      misago/users/management/commands/listusedprofilefields.py
  187. 0 1
      misago/users/management/commands/populateonlinetracker.py
  188. 0 1
      misago/users/management/commands/prepareuserdatadownloads.py
  189. 0 1
      misago/users/management/commands/synchronizeusers.py
  190. 0 1
      misago/users/migrations/0002_users_settings.py
  191. 0 1
      misago/users/migrations/0004_default_ranks.py
  192. 1 0
      misago/users/migrations/0009_redo_partial_indexes.py
  193. 1 0
      misago/users/migrations/0011_auto_20180331_2208.py
  194. 2 2
      misago/users/migrations/0012_audittrail.py
  195. 3 2
      misago/users/migrations/0014_datadownload.py
  196. 2 1
      misago/users/models/user.py
  197. 1 2
      misago/users/online/tracker.py
  198. 0 1
      misago/users/online/utils.py
  199. 0 1
      misago/users/pages.py
  200. 0 1
      misago/users/permissions/decorators.py
  201. 0 1
      misago/users/permissions/delete.py
  202. 0 1
      misago/users/permissions/moderation.py
  203. 0 1
      misago/users/permissions/profiles.py
  204. 0 1
      misago/users/profilefields/basefields.py
  205. 2 1
      misago/users/profilefields/default.py
  206. 0 1
      misago/users/search.py
  207. 1 2
      misago/users/serializers/auth.py
  208. 1 3
      misago/users/serializers/ban.py
  209. 0 1
      misago/users/serializers/datadownload.py
  210. 1 3
      misago/users/serializers/moderation.py
  211. 1 3
      misago/users/serializers/options.py
  212. 0 1
      misago/users/serializers/rank.py
  213. 1 3
      misago/users/serializers/user.py
  214. 0 1
      misago/users/serializers/usernamechange.py
  215. 1 1
      misago/users/setupnewuser.py
  216. 0 1
      misago/users/signals.py
  217. 2 4
      misago/users/social/pipeline.py
  218. 0 1
      misago/users/templatetags/misago_avatars.py
  219. 1 2
      misago/users/tests/test_avatars.py
  220. 1 1
      misago/users/tests/test_bans.py
  221. 0 1
      misago/users/tests/test_bio_profilefield.py
  222. 1 2
      misago/users/tests/test_datadownloads.py
  223. 0 1
      misago/users/tests/test_datadownloads_dataarchive.py
  224. 0 1
      misago/users/tests/test_expireuserdatadownloads.py
  225. 0 1
      misago/users/tests/test_gender_profilefield.py
  226. 0 1
      misago/users/tests/test_invalidatebans.py
  227. 0 1
      misago/users/tests/test_joinip_profilefield.py
  228. 1 1
      misago/users/tests/test_namechanges.py
  229. 0 1
      misago/users/tests/test_profilefields.py
  230. 0 1
      misago/users/tests/test_remove_old_ips_command.py
  231. 1 3
      misago/users/tests/test_social_pipeline.py
  232. 0 1
      misago/users/tests/test_twitter_profilefield.py
  233. 0 1
      misago/users/tests/test_user_model.py
  234. 0 1
      misago/users/tests/test_useradmin_views.py
  235. 0 1
      misago/users/urls/api.py
  236. 0 2
      misago/users/validators.py
  237. 0 1
      misago/users/views/activation.py
  238. 0 1
      misago/users/views/avatarserver.py
  239. 0 1
      misago/users/views/profile.py

+ 3 - 11
.isort.cfg

@@ -1,14 +1,6 @@
 [settings]
 [settings]
-line_length=100
-lines_after_imports=2
-known_crispyforms=crispy_forms
-known_django=django
-known_faker=faker
-kmown_mptt=mptt
-knowm_requests=requests
-known_restframework=rest_framework
-known_unidecode=unidecode
+line_length=89
+lines_after_imports=1
 known_first_party=misago
 known_first_party=misago
-sections=FUTURE,STDLIB,THIRDPARTY,FAKER,MPTT,REQUESTS,RESTFRAMEWORK,UNIDECODE,DJANGO,FIRSTPARTY,LOCALFOLDER
-multi_line_output=4
+multi_line_output=3
 verbose=true
 verbose=true

+ 1 - 0
misago/acl/apps.py

@@ -1,4 +1,5 @@
 from django.apps import AppConfig
 from django.apps import AppConfig
+
 from .providers import providers
 from .providers import providers
 
 
 
 

+ 0 - 1
misago/acl/migrations/0003_default_roles.py

@@ -1,6 +1,5 @@
 from django.db import migrations
 from django.db import migrations
 
 
-
 _ = lambda s: s
 _ = lambda s: s
 
 
 
 

+ 0 - 1
misago/acl/panels.py

@@ -1,5 +1,4 @@
 from debug_toolbar.panels import Panel
 from debug_toolbar.panels import Panel
-
 from django.utils.translation import gettext_lazy as _
 from django.utils.translation import gettext_lazy as _
 
 
 
 

+ 0 - 1
misago/acl/providers.py

@@ -2,7 +2,6 @@ from importlib import import_module
 
 
 from misago.conf import settings
 from misago.conf import settings
 
 
-
 _NOT_INITIALIZED_ERROR = (
 _NOT_INITIALIZED_ERROR = (
     "PermissionProviders instance has to load providers with load() "
     "PermissionProviders instance has to load providers with load() "
     "before get_obj_type_annotators(), get_user_acl_serializers(), "
     "before get_obj_type_annotators(), get_user_acl_serializers(), "

+ 1 - 1
misago/acl/tests/test_roleadmin_views.py

@@ -3,8 +3,8 @@ from django.urls import reverse
 from misago.acl import ACL_CACHE
 from misago.acl import ACL_CACHE
 from misago.acl.models import Role
 from misago.acl.models import Role
 from misago.acl.test import mock_role_form_data
 from misago.acl.test import mock_role_form_data
-from misago.cache.test import assert_invalidates_cache
 from misago.admin.test import AdminTestCase
 from misago.admin.test import AdminTestCase
+from misago.cache.test import assert_invalidates_cache
 
 
 
 
 def create_data(data_dict):
 def create_data(data_dict):

+ 0 - 1
misago/admin/auth.py

@@ -7,7 +7,6 @@ from django.utils.translation import gettext as _
 
 
 from misago.conf import settings
 from misago.conf import settings
 
 
-
 KEY_TOKEN = "misago_admin_session_token"
 KEY_TOKEN = "misago_admin_session_token"
 KEY_UPDATED = "misago_admin_session_updated"
 KEY_UPDATED = "misago_admin_session_updated"
 
 

+ 2 - 2
misago/admin/tests/test_admin_form_templatetags.py

@@ -2,15 +2,15 @@ import pytest
 from django import forms
 from django import forms
 from django.template import Context, Template, TemplateSyntaxError
 from django.template import Context, Template, TemplateSyntaxError
 
 
+from misago.admin.forms import YesNoSwitch
 from misago.admin.templatetags.misago_admin_form import (
 from misago.admin.templatetags.misago_admin_form import (
+    is_multiple_choice_field,
     is_radio_select_field,
     is_radio_select_field,
     is_select_field,
     is_select_field,
-    is_multiple_choice_field,
     is_textarea_field,
     is_textarea_field,
     render_attrs,
     render_attrs,
     render_bool_attrs,
     render_bool_attrs,
 )
 )
-from misago.admin.forms import YesNoSwitch
 
 
 
 
 class Form(forms.Form):
 class Form(forms.Form):

+ 0 - 1
misago/admin/urls.py

@@ -4,7 +4,6 @@ from misago import admin
 
 
 from .views import auth, index
 from .views import auth, index
 
 
-
 urlpatterns = [
 urlpatterns = [
     # "misago:admin:index" link symbolises "root" of Misago admin links space
     # "misago:admin:index" link symbolises "root" of Misago admin links space
     # any request with path that falls below this one is assumed to be directed
     # any request with path that falls below this one is assumed to be directed

+ 0 - 1
misago/admin/views/errorpages.py

@@ -5,7 +5,6 @@ from misago.core.utils import get_exception_message
 
 
 from . import get_protected_namespace, protected_admin_view, render
 from . import get_protected_namespace, protected_admin_view, render
 
 
-
 # Magic error page used by admin
 # Magic error page used by admin
 @protected_admin_view
 @protected_admin_view
 def _error_page(request, code, exception=None, default_message=None):
 def _error_page(request, code, exception=None, default_message=None):

+ 1 - 3
misago/admin/views/index.py

@@ -1,9 +1,8 @@
 import requests
 import requests
-from requests.exceptions import RequestException
-
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
 from django.http import Http404, JsonResponse
 from django.http import Http404, JsonResponse
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from requests.exceptions import RequestException
 
 
 from misago import __version__
 from misago import __version__
 from misago.conf import settings
 from misago.conf import settings
@@ -12,7 +11,6 @@ from misago.threads.models import Post, Thread
 
 
 from . import render
 from . import render
 
 
-
 VERSION_CHECK_CACHE_KEY = "misago_version_check"
 VERSION_CHECK_CACHE_KEY = "misago_version_check"
 
 
 User = get_user_model()
 User = get_user_model()

+ 1 - 1
misago/cache/tests/test_invalidating_caches.py

@@ -1,7 +1,7 @@
 import pytest
 import pytest
 
 
-from misago.cache.versions import CACHE_NAME, invalidate_cache, invalidate_all_caches
 from misago.cache.models import CacheVersion
 from misago.cache.models import CacheVersion
+from misago.cache.versions import CACHE_NAME, invalidate_all_caches, invalidate_cache
 
 
 
 
 @pytest.fixture
 @pytest.fixture

+ 1 - 2
misago/categories/forms.py

@@ -1,9 +1,8 @@
-from mptt.forms import TreeNodeChoiceField, TreeNodeMultipleChoiceField
-
 from django import forms
 from django import forms
 from django.db import models
 from django.db import models
 from django.utils.html import conditional_escape, mark_safe
 from django.utils.html import conditional_escape, mark_safe
 from django.utils.translation import gettext_lazy as _
 from django.utils.translation import gettext_lazy as _
+from mptt.forms import TreeNodeChoiceField, TreeNodeMultipleChoiceField
 
 
 from misago.admin.forms import YesNoSwitch
 from misago.admin.forms import YesNoSwitch
 from misago.core.validators import validate_sluggable
 from misago.core.validators import validate_sluggable

+ 1 - 2
misago/categories/migrations/0001_initial.py

@@ -1,6 +1,5 @@
-import mptt.fields
-
 import django.db.models.deletion
 import django.db.models.deletion
+import mptt.fields
 from django.conf import settings
 from django.conf import settings
 from django.contrib.postgres.fields import JSONField
 from django.contrib.postgres.fields import JSONField
 from django.db import migrations, models
 from django.db import migrations, models

+ 0 - 1
misago/categories/migrations/0002_default_categories.py

@@ -2,7 +2,6 @@ from django.db import migrations
 
 
 from misago.core.utils import slugify
 from misago.core.utils import slugify
 
 
-
 _ = lambda s: s
 _ = lambda s: s
 
 
 
 

+ 0 - 1
misago/categories/migrations/0003_categories_roles.py

@@ -1,6 +1,5 @@
 from django.db import migrations
 from django.db import migrations
 
 
-
 _ = lambda s: s
 _ = lambda s: s
 
 
 
 

+ 0 - 1
misago/categories/migrations/0006_moderation_queue_roles.py

@@ -1,6 +1,5 @@
 from django.db import migrations
 from django.db import migrations
 
 
-
 _ = lambda s: s
 _ = lambda s: s
 
 
 
 

+ 0 - 1
misago/categories/migrations/0007_best_answers_roles.py

@@ -1,7 +1,6 @@
 # Generated by Django 1.11.9 on 2018-03-18 20:40
 # Generated by Django 1.11.9 on 2018-03-18 20:40
 from django.db import migrations
 from django.db import migrations
 
 
-
 _ = lambda s: s
 _ = lambda s: s
 
 
 
 

+ 1 - 2
misago/categories/models.py

@@ -1,8 +1,7 @@
+from django.db import models
 from mptt.managers import TreeManager
 from mptt.managers import TreeManager
 from mptt.models import MPTTModel, TreeForeignKey
 from mptt.models import MPTTModel, TreeForeignKey
 
 
-from django.db import models
-
 from misago.acl.cache import clear_acl_cache
 from misago.acl.cache import clear_acl_cache
 from misago.acl.models import BaseRole
 from misago.acl.models import BaseRole
 from misago.conf import settings
 from misago.conf import settings

+ 1 - 3
misago/categories/serializers.py

@@ -1,13 +1,11 @@
-from rest_framework import serializers
-
 from django.urls import reverse
 from django.urls import reverse
+from rest_framework import serializers
 
 
 from misago.core.serializers import MutableFields
 from misago.core.serializers import MutableFields
 from misago.core.utils import format_plaintext_for_html
 from misago.core.utils import format_plaintext_for_html
 
 
 from .models import Category
 from .models import Category
 
 
-
 __all__ = ["CategorySerializer"]
 __all__ = ["CategorySerializer"]
 
 
 
 

+ 0 - 1
misago/categories/signals.py

@@ -4,7 +4,6 @@ from misago.users.signals import anonymize_user_data, username_changed
 
 
 from .models import Category
 from .models import Category
 
 
-
 delete_category_content = Signal()
 delete_category_content = Signal()
 move_category_content = Signal(providing_args=["new_category"])
 move_category_content = Signal(providing_args=["new_category"])
 
 

+ 0 - 1
misago/categories/urls/api.py

@@ -1,7 +1,6 @@
 from misago.categories.api import CategoryViewSet
 from misago.categories.api import CategoryViewSet
 from misago.core.apirouter import MisagoApiRouter
 from misago.core.apirouter import MisagoApiRouter
 
 
-
 router = MisagoApiRouter()
 router = MisagoApiRouter()
 router.register(r"categories", CategoryViewSet, base_name="category")
 router.register(r"categories", CategoryViewSet, base_name="category")
 urlpatterns = router.urls
 urlpatterns = router.urls

+ 0 - 1
misago/conf/migrations/0002_cache_version.py

@@ -2,7 +2,6 @@
 from django.db import migrations
 from django.db import migrations
 
 
 from misago.cache.operations import StartCacheVersioning
 from misago.cache.operations import StartCacheVersioning
-
 from misago.conf import SETTINGS_CACHE
 from misago.conf import SETTINGS_CACHE
 
 
 
 

+ 0 - 1
misago/conf/tests/test_dynamic_settings_middleware.py

@@ -1,7 +1,6 @@
 from unittest.mock import Mock, PropertyMock
 from unittest.mock import Mock, PropertyMock
 
 
 import pytest
 import pytest
-
 from django.utils.functional import SimpleLazyObject
 from django.utils.functional import SimpleLazyObject
 
 
 from misago.conf.middleware import dynamic_settings_middleware
 from misago.conf.middleware import dynamic_settings_middleware

+ 0 - 1
misago/conf/tests/test_getting_static_settings_values.py

@@ -1,5 +1,4 @@
 import pytest
 import pytest
-
 from django.test import override_settings
 from django.test import override_settings
 
 
 
 

+ 1 - 3
misago/core/apipatch.py

@@ -1,9 +1,7 @@
-from rest_framework.response import Response
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.db import transaction
 from django.db import transaction
 from django.http import Http404
 from django.http import Http404
-
+from rest_framework.response import Response
 
 
 ALLOWED_OPS = ("add", "remove", "replace")
 ALLOWED_OPS = ("add", "remove", "replace")
 
 

+ 2 - 2
misago/core/cache.py

@@ -1,6 +1,6 @@
+from django.core.cache import InvalidCacheBackendError
 from django.core.cache import cache as default_cache
 from django.core.cache import cache as default_cache
-from django.core.cache import InvalidCacheBackendError, caches
-
+from django.core.cache import caches
 
 
 try:
 try:
     cache = caches["misago"]
     cache = caches["misago"]

+ 1 - 1
misago/core/errorpages.py

@@ -4,7 +4,7 @@ from django.utils.translation import gettext as _
 from social_core import exceptions as social_exceptions
 from social_core import exceptions as social_exceptions
 
 
 from misago.admin.views.errorpages import admin_csrf_failure, admin_error_page
 from misago.admin.views.errorpages import admin_csrf_failure, admin_error_page
-from misago.core.exceptions import SocialAuthFailed, SocialAuthBanned
+from misago.core.exceptions import SocialAuthBanned, SocialAuthFailed
 from misago.users.social.utils import get_social_auth_backend_name
 from misago.users.social.utils import get_social_auth_backend_name
 
 
 from .utils import get_exception_message, is_request_to_misago
 from .utils import get_exception_message, is_request_to_misago

+ 1 - 3
misago/core/exceptionhandler.py

@@ -1,15 +1,13 @@
-from rest_framework.views import exception_handler as rest_exception_handler
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.http import Http404, HttpResponsePermanentRedirect, JsonResponse
 from django.http import Http404, HttpResponsePermanentRedirect, JsonResponse
 from django.urls import reverse
 from django.urls import reverse
+from rest_framework.views import exception_handler as rest_exception_handler
 from social_core.exceptions import SocialAuthBaseException
 from social_core.exceptions import SocialAuthBaseException
 from social_core.utils import social_logger
 from social_core.utils import social_logger
 
 
 from . import errorpages
 from . import errorpages
 from .exceptions import AjaxError, Banned, ExplicitFirstPage, OutdatedSlug
 from .exceptions import AjaxError, Banned, ExplicitFirstPage, OutdatedSlug
 
 
-
 HANDLED_EXCEPTIONS = (
 HANDLED_EXCEPTIONS = (
     AjaxError,
     AjaxError,
     Banned,
     Banned,

+ 0 - 1
misago/core/migrations/0002_basic_settings.py

@@ -2,7 +2,6 @@ from django.db import migrations
 
 
 from misago.conf.migrationutils import migrate_settings_group
 from misago.conf.migrationutils import migrate_settings_group
 
 
-
 _ = lambda s: s
 _ = lambda s: s
 
 
 
 

+ 0 - 1
misago/core/momentjs.py

@@ -1,6 +1,5 @@
 from misago.conf import settings
 from misago.conf import settings
 
 
-
 MOMENT_STATIC_PATH = "misago/momentjs/%s.js"
 MOMENT_STATIC_PATH = "misago/momentjs/%s.js"
 
 
 
 

+ 1 - 2
misago/core/rest_permissions.py

@@ -1,7 +1,6 @@
-from rest_framework.permissions import SAFE_METHODS, BasePermission
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework.permissions import SAFE_METHODS, BasePermission
 
 
 
 
 class IsAuthenticatedOrReadOnly(BasePermission):
 class IsAuthenticatedOrReadOnly(BasePermission):

+ 1 - 2
misago/core/shortcuts.py

@@ -1,6 +1,5 @@
-from rest_framework.response import Response
-
 from django.http import Http404
 from django.http import Http404
+from rest_framework.response import Response
 
 
 
 
 def paginate(
 def paginate(

+ 1 - 2
misago/core/slugify.py

@@ -1,6 +1,5 @@
-from unidecode import unidecode
-
 from django.template.defaultfilters import slugify as django_slugify
 from django.template.defaultfilters import slugify as django_slugify
+from unidecode import unidecode
 
 
 
 
 def default(string):
 def default(string):

+ 0 - 1
misago/core/templatetags/misago_batch.py

@@ -1,6 +1,5 @@
 from django import template
 from django import template
 
 
-
 register = template.Library()
 register = template.Library()
 
 
 
 

+ 0 - 1
misago/core/templatetags/misago_capture.py

@@ -9,7 +9,6 @@ Syntax:
 
 
 from django import template
 from django import template
 
 
-
 register = template.Library()
 register = template.Library()
 SYNTAX_ERROR = 'capture tag syntax is "capture [trimmed] as [value]"'
 SYNTAX_ERROR = 'capture tag syntax is "capture [trimmed] as [value]"'
 
 

+ 0 - 1
misago/core/templatetags/misago_json.py

@@ -5,7 +5,6 @@ from django.utils.safestring import mark_safe
 
 
 from misago.core.utils import encode_json_html
 from misago.core.utils import encode_json_html
 
 
-
 register = template.Library()
 register = template.Library()
 
 
 
 

+ 0 - 1
misago/core/templatetags/misago_pagetitle.py

@@ -1,7 +1,6 @@
 from django import template
 from django import template
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
 
 
-
 register = template.Library()
 register = template.Library()
 
 
 
 

+ 0 - 1
misago/core/templatetags/misago_shorthands.py

@@ -1,6 +1,5 @@
 from django import template
 from django import template
 
 
-
 register = template.Library()
 register = template.Library()
 
 
 
 

+ 0 - 1
misago/core/templatetags/misago_stringutils.py

@@ -1,6 +1,5 @@
 from django import template
 from django import template
 
 
-
 register = template.Library()
 register = template.Library()
 
 
 
 

+ 0 - 1
misago/core/testproject/urls.py

@@ -11,7 +11,6 @@ from misago.users.forms.auth import AdminAuthenticationForm
 
 
 from . import views
 from . import views
 
 
-
 admin.autodiscover()
 admin.autodiscover()
 admin.site.login_form = AdminAuthenticationForm
 admin.site.login_form = AdminAuthenticationForm
 
 

+ 0 - 1
misago/core/testproject/urlswitherrorhandlers.py

@@ -1,5 +1,4 @@
 from .urls import *
 from .urls import *
 
 
-
 handler403 = "misago.core.testproject.views.mock_custom_403_error_page"
 handler403 = "misago.core.testproject.views.mock_custom_403_error_page"
 handler404 = "misago.core.testproject.views.mock_custom_404_error_page"
 handler404 = "misago.core.testproject.views.mock_custom_404_error_page"

+ 2 - 3
misago/core/testproject/views.py

@@ -1,9 +1,8 @@
-from rest_framework.decorators import api_view
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.http import Http404, HttpResponse
 from django.http import Http404, HttpResponse
-from social_core.exceptions import AuthFailed, NotAllowedToDisconnect, WrongBackend
+from rest_framework.decorators import api_view
 from social_core.backends.github import GithubOAuth2
 from social_core.backends.github import GithubOAuth2
+from social_core.exceptions import AuthFailed, NotAllowedToDisconnect, WrongBackend
 
 
 from misago.core import errorpages
 from misago.core import errorpages
 from misago.core.decorators import require_POST
 from misago.core.decorators import require_POST

+ 0 - 1
misago/core/tests/test_checks.py

@@ -4,7 +4,6 @@ from django.test import TestCase
 
 
 from misago.core import SUPPORTED_ENGINES, check_db_engine
 from misago.core import SUPPORTED_ENGINES, check_db_engine
 
 
-
 INVALID_ENGINES = [
 INVALID_ENGINES = [
     "django.db.backends.sqlite3",
     "django.db.backends.sqlite3",
     "django.db.backends.mysql",
     "django.db.backends.mysql",

+ 1 - 1
misago/core/tests/test_errorpages.py

@@ -5,7 +5,6 @@ from django.test.client import RequestFactory
 from django.urls import reverse
 from django.urls import reverse
 
 
 from misago.acl.useracl import get_user_acl
 from misago.acl.useracl import get_user_acl
-from misago.users.models import AnonymousUser
 from misago.conf.dynamicsettings import DynamicSettings
 from misago.conf.dynamicsettings import DynamicSettings
 from misago.conftest import get_cache_versions
 from misago.conftest import get_cache_versions
 from misago.core.testproject.views import (
 from misago.core.testproject.views import (
@@ -13,6 +12,7 @@ from misago.core.testproject.views import (
     mock_custom_404_error_page,
     mock_custom_404_error_page,
 )
 )
 from misago.core.utils import encode_json_html
 from misago.core.utils import encode_json_html
+from misago.users.models import AnonymousUser
 
 
 
 
 class CSRFErrorViewTests(TestCase):
 class CSRFErrorViewTests(TestCase):

+ 1 - 3
misago/core/tests/test_exceptionhandler_middleware.py

@@ -5,11 +5,9 @@ from django.urls import reverse
 
 
 from misago.acl.useracl import get_user_acl
 from misago.acl.useracl import get_user_acl
 from misago.conf.dynamicsettings import DynamicSettings
 from misago.conf.dynamicsettings import DynamicSettings
-from misago.core.middleware import ExceptionHandlerMiddleware
 from misago.conftest import get_cache_versions
 from misago.conftest import get_cache_versions
-from misago.users.models import AnonymousUser
-
 from misago.core.middleware import ExceptionHandlerMiddleware
 from misago.core.middleware import ExceptionHandlerMiddleware
+from misago.users.models import AnonymousUser
 
 
 
 
 def create_request():
 def create_request():

+ 0 - 1
misago/core/tests/test_exceptionhandlers.py

@@ -7,7 +7,6 @@ from misago.core import exceptionhandler
 from misago.core.exceptions import Banned
 from misago.core.exceptions import Banned
 from misago.users.models import Ban
 from misago.users.models import Ban
 
 
-
 INVALID_EXCEPTIONS = [
 INVALID_EXCEPTIONS = [
     django_exceptions.ObjectDoesNotExist,
     django_exceptions.ObjectDoesNotExist,
     django_exceptions.ViewDoesNotExist,
     django_exceptions.ViewDoesNotExist,

+ 0 - 1
misago/core/tests/test_jsi18n.py

@@ -5,7 +5,6 @@ from django.test import TestCase
 from django.urls import reverse
 from django.urls import reverse
 from django.utils import translation
 from django.utils import translation
 
 
-
 MISAGO_DIR = os.path.dirname(
 MISAGO_DIR = os.path.dirname(
     os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
     os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 )
 )

+ 1 - 2
misago/core/tests/test_pgpartialindex.py

@@ -1,9 +1,8 @@
 from django.db import connection
 from django.db import connection
 from django.test import TestCase
 from django.test import TestCase
 
 
-from misago.threads.models import Thread
-
 from misago.core.pgutils import PgPartialIndex
 from misago.core.pgutils import PgPartialIndex
+from misago.threads.models import Thread
 
 
 
 
 class PgPartialIndexTests(TestCase):
 class PgPartialIndexTests(TestCase):

+ 1 - 2
misago/core/tests/test_serializers.py

@@ -1,6 +1,5 @@
-from rest_framework import serializers
-
 from django.test import TestCase
 from django.test import TestCase
+from rest_framework import serializers
 
 
 from misago.categories.models import Category
 from misago.categories.models import Category
 from misago.core.serializers import MutableFields
 from misago.core.serializers import MutableFields

+ 0 - 1
misago/core/tests/test_templatetags.py

@@ -4,7 +4,6 @@ from django.test import TestCase, override_settings
 from misago.core.templatetags import misago_batch
 from misago.core.templatetags import misago_batch
 from misago.core.templatetags.misago_absoluteurl import absoluteurl
 from misago.core.templatetags.misago_absoluteurl import absoluteurl
 
 
-
 TEST_ADDRESS = "https://testsite.com/"
 TEST_ADDRESS = "https://testsite.com/"
 
 
 
 

+ 3 - 3
misago/core/tests/test_utils.py

@@ -4,15 +4,15 @@ from django.test.client import RequestFactory
 from django.urls import reverse
 from django.urls import reverse
 
 
 from misago.core.utils import (
 from misago.core.utils import (
+    clean_ids_list,
     clean_return_path,
     clean_return_path,
     format_plaintext_for_html,
     format_plaintext_for_html,
+    get_exception_message,
+    get_host_from_address,
     is_referer_local,
     is_referer_local,
     is_request_to_misago,
     is_request_to_misago,
     parse_iso8601_string,
     parse_iso8601_string,
     slugify,
     slugify,
-    get_exception_message,
-    clean_ids_list,
-    get_host_from_address,
 )
 )
 
 
 
 

+ 0 - 1
misago/core/utils.py

@@ -8,7 +8,6 @@ from django.utils import html, timezone
 from django.utils.encoding import force_text
 from django.utils.encoding import force_text
 from django.utils.module_loading import import_string
 from django.utils.module_loading import import_string
 
 
-
 MISAGO_SLUGIFY = getattr(settings, "MISAGO_SLUGIFY", "misago.core.slugify.default")
 MISAGO_SLUGIFY = getattr(settings, "MISAGO_SLUGIFY", "misago.core.slugify.default")
 
 
 slugify = import_string(MISAGO_SLUGIFY)
 slugify = import_string(MISAGO_SLUGIFY)

+ 0 - 1
misago/faker/englishcorpus.py

@@ -1,7 +1,6 @@
 import os
 import os
 import random
 import random
 
 
-
 PHRASES_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "phrases.txt")
 PHRASES_FILE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "phrases.txt")
 
 
 
 

+ 1 - 2
misago/faker/management/commands/createfakebans.py

@@ -2,10 +2,9 @@ import random
 import sys
 import sys
 from datetime import timedelta
 from datetime import timedelta
 
 
-from faker import Factory
-
 from django.core.management.base import BaseCommand
 from django.core.management.base import BaseCommand
 from django.utils import timezone
 from django.utils import timezone
+from faker import Factory
 
 
 from misago.core.management.progressbar import show_progress
 from misago.core.management.progressbar import show_progress
 from misago.users.models import Ban
 from misago.users.models import Ban

+ 1 - 2
misago/faker/management/commands/createfakecategories.py

@@ -1,9 +1,8 @@
 import random
 import random
 import time
 import time
 
 
-from faker import Factory
-
 from django.core.management.base import BaseCommand
 from django.core.management.base import BaseCommand
+from faker import Factory
 
 
 from misago.acl.cache import clear_acl_cache
 from misago.acl.cache import clear_acl_cache
 from misago.categories.models import Category, RoleCategoryACL
 from misago.categories.models import Category, RoleCategoryACL

+ 0 - 1
misago/faker/management/commands/createfakefollowers.py

@@ -6,7 +6,6 @@ from django.core.management.base import BaseCommand
 
 
 from misago.core.management.progressbar import show_progress
 from misago.core.management.progressbar import show_progress
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 1 - 3
misago/faker/management/commands/createfakethreads.py

@@ -1,12 +1,11 @@
 import random
 import random
 import time
 import time
 
 
-from faker import Factory
-
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
 from django.core.management.base import BaseCommand
 from django.core.management.base import BaseCommand
 from django.db.transaction import atomic
 from django.db.transaction import atomic
 from django.utils import timezone
 from django.utils import timezone
+from faker import Factory
 
 
 from misago.categories.models import Category
 from misago.categories.models import Category
 from misago.core.management.progressbar import show_progress
 from misago.core.management.progressbar import show_progress
@@ -14,7 +13,6 @@ from misago.faker.englishcorpus import EnglishCorpus
 from misago.threads.checksums import update_post_checksum
 from misago.threads.checksums import update_post_checksum
 from misago.threads.models import Post, Thread
 from misago.threads.models import Post, Thread
 
 
-
 PLACEKITTEN_URL = "https://placekitten.com/g/%s/%s"
 PLACEKITTEN_URL = "https://placekitten.com/g/%s/%s"
 
 
 User = get_user_model()
 User = get_user_model()

+ 1 - 3
misago/faker/management/commands/createfakeusers.py

@@ -1,18 +1,16 @@
 import random
 import random
 import time
 import time
 
 
-from faker import Factory
-
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
 from django.core.exceptions import ValidationError
 from django.core.exceptions import ValidationError
 from django.core.management.base import BaseCommand
 from django.core.management.base import BaseCommand
 from django.db import IntegrityError
 from django.db import IntegrityError
+from faker import Factory
 
 
 from misago.core.management.progressbar import show_progress
 from misago.core.management.progressbar import show_progress
 from misago.users.avatars import dynamic, gallery
 from misago.users.avatars import dynamic, gallery
 from misago.users.models import Rank
 from misago.users.models import Rank
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 0 - 1
misago/legal/api.py

@@ -2,7 +2,6 @@ from django.contrib.auth import logout
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.shortcuts import get_object_or_404
 from django.shortcuts import get_object_or_404
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
-
 from rest_framework.decorators import api_view
 from rest_framework.decorators import api_view
 from rest_framework.response import Response
 from rest_framework.response import Response
 
 

+ 0 - 1
misago/legal/context_processors.py

@@ -3,7 +3,6 @@ from django.urls import reverse
 from .models import Agreement
 from .models import Agreement
 from .utils import get_parsed_agreement_text, get_required_user_agreement
 from .utils import get_parsed_agreement_text, get_required_user_agreement
 
 
-
 # fixme: rename this context processor to more suitable name
 # fixme: rename this context processor to more suitable name
 def legal_links(request):
 def legal_links(request):
     agreements = Agreement.objects.get_agreements()
     agreements = Agreement.objects.get_agreements()

+ 0 - 1
misago/legal/migrations/0001_initial.py

@@ -2,7 +2,6 @@ from django.db import migrations
 
 
 from misago.conf.migrationutils import migrate_settings_group
 from misago.conf.migrationutils import migrate_settings_group
 
 
-
 _ = lambda s: s
 _ = lambda s: s
 
 
 
 

+ 2 - 2
misago/legal/migrations/0002_agreement_useragreement.py

@@ -1,8 +1,8 @@
 # Generated by Django 1.11.15 on 2018-08-15 20:58
 # Generated by Django 1.11.15 on 2018-08-15 20:58
-from django.conf import settings
-from django.db import migrations, models
 import django.db.models.deletion
 import django.db.models.deletion
 import django.utils.timezone
 import django.utils.timezone
+from django.conf import settings
+from django.db import migrations, models
 
 
 
 
 class Migration(migrations.Migration):
 class Migration(migrations.Migration):

+ 0 - 1
misago/legal/migrations/0003_create_agreements_from_settings.py

@@ -4,7 +4,6 @@ from django.db import migrations
 from misago.conf.migrationutils import migrate_settings_group
 from misago.conf.migrationutils import migrate_settings_group
 from misago.legal.models import Agreement as MisagoAgreement
 from misago.legal.models import Agreement as MisagoAgreement
 
 
-
 _ = lambda s: s
 _ = lambda s: s
 
 
 
 

+ 0 - 1
misago/legal/models.py

@@ -5,7 +5,6 @@ from django.utils.translation import gettext_lazy as _
 from misago.conf import settings
 from misago.conf import settings
 from misago.core.cache import cache
 from misago.core.cache import cache
 
 
-
 CACHE_KEY = "misago_agreements"
 CACHE_KEY = "misago_agreements"
 
 
 
 

+ 0 - 1
misago/legal/urls/api.py

@@ -2,7 +2,6 @@ from django.conf.urls import url
 
 
 from misago.legal.api import submit_agreement
 from misago.legal.api import submit_agreement
 
 
-
 urlpatterns = [
 urlpatterns = [
     url(r"^submit-agreement/(?P<pk>\d+)/$", submit_agreement, name="submit-agreement")
     url(r"^submit-agreement/(?P<pk>\d+)/$", submit_agreement, name="submit-agreement")
 ]
 ]

+ 0 - 1
misago/legal/views/admin.py

@@ -3,7 +3,6 @@ from django.utils import timezone
 from django.utils.translation import gettext_lazy as _
 from django.utils.translation import gettext_lazy as _
 
 
 from misago.admin.views import generic
 from misago.admin.views import generic
-
 from misago.legal.forms import AgreementForm, SearchAgreementsForm
 from misago.legal.forms import AgreementForm, SearchAgreementsForm
 from misago.legal.models import Agreement
 from misago.legal.models import Agreement
 from misago.legal.utils import set_agreement_as_active
 from misago.legal.utils import set_agreement_as_active

+ 1 - 3
misago/markup/bbcode/blocks.py

@@ -1,14 +1,12 @@
 import re
 import re
 
 
 import markdown
 import markdown
+from django.utils.crypto import get_random_string
 from markdown.blockprocessors import BlockProcessor, HRProcessor
 from markdown.blockprocessors import BlockProcessor, HRProcessor
 from markdown.extensions.fenced_code import FencedBlockPreprocessor
 from markdown.extensions.fenced_code import FencedBlockPreprocessor
 from markdown.preprocessors import Preprocessor
 from markdown.preprocessors import Preprocessor
 from markdown.util import etree
 from markdown.util import etree
 
 
-from django.utils.crypto import get_random_string
-
-
 QUOTE_START = get_random_string(32)
 QUOTE_START = get_random_string(32)
 QUOTE_END = get_random_string(32)
 QUOTE_END = get_random_string(32)
 
 

+ 0 - 1
misago/markup/finalise.py

@@ -2,7 +2,6 @@ import re
 
 
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
 
 
-
 HEADER_RE = re.compile(
 HEADER_RE = re.compile(
     r"""
     r"""
 <div class="quote-heading">(?P<title>.*?)</div>
 <div class="quote-heading">(?P<title>.*?)</div>

+ 0 - 1
misago/markup/md/shortimgs.py

@@ -2,7 +2,6 @@ import markdown
 from markdown.inlinepatterns import LinkPattern
 from markdown.inlinepatterns import LinkPattern
 from markdown.util import etree
 from markdown.util import etree
 
 
-
 IMAGES_RE = r"\!(\s?)\((<.*?>|([^\)]*))\)"
 IMAGES_RE = r"\!(\s?)\((<.*?>|([^\)]*))\)"
 
 
 
 

+ 0 - 1
misago/markup/md/striketrough.py

@@ -1,7 +1,6 @@
 import markdown
 import markdown
 from markdown.inlinepatterns import SimpleTagPattern
 from markdown.inlinepatterns import SimpleTagPattern
 
 
-
 STRIKETROUGH_RE = r"(~{2})(.+?)\2"
 STRIKETROUGH_RE = r"(~{2})(.+?)\2"
 
 
 
 

+ 0 - 2
misago/markup/mentions.py

@@ -1,10 +1,8 @@
 import re
 import re
 
 
 from bs4 import BeautifulSoup
 from bs4 import BeautifulSoup
-
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
 
 
-
 SUPPORTED_TAGS = ("h1", "h2", "h3", "h4", "h5", "h6", "div", "p")
 SUPPORTED_TAGS = ("h1", "h2", "h3", "h4", "h5", "h6", "div", "p")
 USERNAME_RE = re.compile(r"@[0-9a-z]+", re.IGNORECASE)
 USERNAME_RE = re.compile(r"@[0-9a-z]+", re.IGNORECASE)
 MENTIONS_LIMIT = 24
 MENTIONS_LIMIT = 24

+ 2 - 4
misago/markup/parser.py

@@ -3,11 +3,10 @@ import warnings
 import bleach
 import bleach
 import markdown
 import markdown
 from bs4 import BeautifulSoup
 from bs4 import BeautifulSoup
-from htmlmin.minify import html_minify
-from markdown.extensions.fenced_code import FencedCodeExtension
-
 from django.http import Http404
 from django.http import Http404
 from django.urls import resolve
 from django.urls import resolve
+from htmlmin.minify import html_minify
+from markdown.extensions.fenced_code import FencedCodeExtension
 
 
 from misago.conf import settings
 from misago.conf import settings
 
 
@@ -17,7 +16,6 @@ from .md.striketrough import StriketroughExtension
 from .mentions import add_mentions
 from .mentions import add_mentions
 from .pipeline import pipeline
 from .pipeline import pipeline
 
 
-
 MISAGO_ATTACHMENT_VIEWS = ("misago:attachment", "misago:attachment-thumbnail")
 MISAGO_ATTACHMENT_VIEWS = ("misago:attachment", "misago:attachment-thumbnail")
 
 
 
 

+ 0 - 1
misago/markup/templatetags/misago_editor.py

@@ -2,7 +2,6 @@ from django import template
 from django.template import Context
 from django.template import Context
 from django.template.loader import get_template
 from django.template.loader import get_template
 
 
-
 register = template.Library()
 register = template.Library()
 
 
 
 

+ 0 - 1
misago/markup/urls.py

@@ -2,5 +2,4 @@ from django.conf.urls import url
 
 
 from .api import parse_markup
 from .api import parse_markup
 
 
-
 urlpatterns = [url(r"^parse-markup/$", parse_markup, name="parse-markup")]
 urlpatterns = [url(r"^parse-markup/$", parse_markup, name="parse-markup")]

+ 2 - 2
misago/readtracker/migrations/0002_postread.py

@@ -1,8 +1,8 @@
 # Generated by Django 1.11.5 on 2017-10-07 14:32
 # Generated by Django 1.11.5 on 2017-10-07 14:32
-from django.conf import settings
-from django.db import migrations, models
 import django.db.models.deletion
 import django.db.models.deletion
 import django.utils.timezone
 import django.utils.timezone
+from django.conf import settings
+from django.db import migrations, models
 
 
 
 
 class Migration(migrations.Migration):
 class Migration(migrations.Migration):

+ 1 - 2
misago/readtracker/migrations/0003_migrate_reads_to_posts.py

@@ -1,13 +1,12 @@
 # Generated by Django 1.11.5 on 2017-10-07 14:49
 # Generated by Django 1.11.5 on 2017-10-07 14:49
 from datetime import timedelta
 from datetime import timedelta
 
 
-from django.db import migrations
 from django.conf import settings
 from django.conf import settings
+from django.db import migrations
 from django.utils import timezone
 from django.utils import timezone
 
 
 from misago.conf import defaults
 from misago.conf import defaults
 
 
-
 try:
 try:
     READS_CUTOFF = settings.MISAGO_READTRACKER_CUTOFF
     READS_CUTOFF = settings.MISAGO_READTRACKER_CUTOFF
 except AttributeError:
 except AttributeError:

+ 1 - 2
misago/readtracker/signals.py

@@ -2,8 +2,7 @@ from django.dispatch import Signal, receiver
 
 
 from misago.categories import PRIVATE_THREADS_ROOT_NAME
 from misago.categories import PRIVATE_THREADS_ROOT_NAME
 from misago.categories.signals import delete_category_content, move_category_content
 from misago.categories.signals import delete_category_content, move_category_content
-from misago.threads.signals import merge_thread, move_thread, merge_post, move_post
-
+from misago.threads.signals import merge_post, merge_thread, move_post, move_thread
 
 
 thread_read = Signal(providing_args=["thread"])
 thread_read = Signal(providing_args=["thread"])
 
 

+ 1 - 1
misago/readtracker/tests/test_categoriestracker.py

@@ -7,7 +7,7 @@ from misago.acl.useracl import get_user_acl
 from misago.categories.models import Category
 from misago.categories.models import Category
 from misago.conf import settings
 from misago.conf import settings
 from misago.conftest import get_cache_versions
 from misago.conftest import get_cache_versions
-from misago.readtracker import poststracker, categoriestracker
+from misago.readtracker import categoriestracker, poststracker
 from misago.readtracker.models import PostRead
 from misago.readtracker.models import PostRead
 from misago.threads import test
 from misago.threads import test
 from misago.users.test import create_test_user
 from misago.users.test import create_test_user

+ 2 - 3
misago/search/api.py

@@ -1,11 +1,10 @@
 from time import time
 from time import time
 
 
-from rest_framework.decorators import api_view
-from rest_framework.response import Response
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.urls import reverse
 from django.urls import reverse
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework.decorators import api_view
+from rest_framework.response import Response
 
 
 from misago.core.shortcuts import get_int_or_404
 from misago.core.shortcuts import get_int_or_404
 
 

+ 0 - 1
misago/search/urls/api.py

@@ -2,7 +2,6 @@ from django.conf.urls import url
 
 
 from misago.search import api
 from misago.search import api
 
 
-
 urlpatterns = [
 urlpatterns = [
     url(r"^search/$", api.search, name="search"),
     url(r"^search/$", api.search, name="search"),
     url(r"^search/(?P<search_provider>[-a-zA-Z0-9]+)/$", api.search, name="search"),
     url(r"^search/(?P<search_provider>[-a-zA-Z0-9]+)/$", api.search, name="search"),

+ 0 - 1
misago/threads/anonymize.py

@@ -1,6 +1,5 @@
 from django.urls import reverse
 from django.urls import reverse
 
 
-
 ANONYMIZABLE_EVENTS = (
 ANONYMIZABLE_EVENTS = (
     "added_participant",
     "added_participant",
     "changed_owner",
     "changed_owner",

+ 2 - 4
misago/threads/api/attachments.py

@@ -1,16 +1,14 @@
-from rest_framework import viewsets
-from rest_framework.response import Response
-
 from django.core.exceptions import PermissionDenied, ValidationError
 from django.core.exceptions import PermissionDenied, ValidationError
 from django.template.defaultfilters import filesizeformat
 from django.template.defaultfilters import filesizeformat
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework import viewsets
+from rest_framework.response import Response
 
 
 from misago.acl.objectacl import add_acl_to_obj
 from misago.acl.objectacl import add_acl_to_obj
 from misago.threads.models import Attachment, AttachmentType
 from misago.threads.models import Attachment, AttachmentType
 from misago.threads.serializers import AttachmentSerializer
 from misago.threads.serializers import AttachmentSerializer
 from misago.users.audittrail import create_audit_trail
 from misago.users.audittrail import create_audit_trail
 
 
-
 IMAGE_EXTENSIONS = ("jpg", "jpeg", "png", "gif")
 IMAGE_EXTENSIONS = ("jpg", "jpeg", "png", "gif")
 
 
 
 

+ 1 - 1
misago/threads/api/pollvotecreateendpoint.py

@@ -4,7 +4,7 @@ from rest_framework.response import Response
 
 
 from misago.acl.objectacl import add_acl_to_obj
 from misago.acl.objectacl import add_acl_to_obj
 from misago.threads.permissions import allow_vote_poll
 from misago.threads.permissions import allow_vote_poll
-from misago.threads.serializers import PollSerializer, NewVoteSerializer
+from misago.threads.serializers import NewVoteSerializer, PollSerializer
 
 
 
 
 def poll_vote_create(request, thread, poll):
 def poll_vote_create(request, thread, poll):

+ 2 - 4
misago/threads/api/postendpoints/delete.py

@@ -1,8 +1,7 @@
-from rest_framework.response import Response
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
 from django.utils.translation import ngettext
 from django.utils.translation import ngettext
+from rest_framework.response import Response
 
 
 from misago.conf import settings
 from misago.conf import settings
 from misago.core.utils import clean_ids_list
 from misago.core.utils import clean_ids_list
@@ -11,11 +10,10 @@ from misago.threads.permissions import (
     allow_delete_best_answer,
     allow_delete_best_answer,
     allow_delete_event,
     allow_delete_event,
     allow_delete_post,
     allow_delete_post,
+    exclude_invisible_posts,
 )
 )
-from misago.threads.permissions import exclude_invisible_posts
 from misago.threads.serializers import DeletePostsSerializer
 from misago.threads.serializers import DeletePostsSerializer
 
 
-
 DELETE_LIMIT = settings.MISAGO_POSTS_PER_PAGE + settings.MISAGO_POSTS_TAIL
 DELETE_LIMIT = settings.MISAGO_POSTS_PER_PAGE + settings.MISAGO_POSTS_TAIL
 
 
 
 

+ 1 - 2
misago/threads/api/postendpoints/edits.py

@@ -1,10 +1,9 @@
-from rest_framework.response import Response
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.db.models import F
 from django.db.models import F
 from django.shortcuts import get_object_or_404
 from django.shortcuts import get_object_or_404
 from django.utils import timezone
 from django.utils import timezone
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework.response import Response
 
 
 from misago.acl.objectacl import add_acl_to_obj
 from misago.acl.objectacl import add_acl_to_obj
 from misago.core.shortcuts import get_int_or_404
 from misago.core.shortcuts import get_int_or_404

+ 1 - 2
misago/threads/api/postendpoints/merge.py

@@ -1,7 +1,6 @@
-from rest_framework.response import Response
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework.response import Response
 
 
 from misago.acl.objectacl import add_acl_to_obj
 from misago.acl.objectacl import add_acl_to_obj
 from misago.threads.serializers import MergePostsSerializer, PostSerializer
 from misago.threads.serializers import MergePostsSerializer, PostSerializer

+ 1 - 2
misago/threads/api/postendpoints/move.py

@@ -1,7 +1,6 @@
-from rest_framework.response import Response
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework.response import Response
 
 
 from misago.threads.serializers import MovePostsSerializer
 from misago.threads.serializers import MovePostsSerializer
 
 

+ 0 - 1
misago/threads/api/postendpoints/patch_event.py

@@ -6,7 +6,6 @@ from misago.core.apipatch import ApiPatch
 from misago.threads.moderation import posts as moderation
 from misago.threads.moderation import posts as moderation
 from misago.threads.permissions import allow_hide_event, allow_unhide_event
 from misago.threads.permissions import allow_hide_event, allow_unhide_event
 
 
-
 event_patch_dispatcher = ApiPatch()
 event_patch_dispatcher = ApiPatch()
 
 
 
 

+ 3 - 5
misago/threads/api/postendpoints/patch_post.py

@@ -1,8 +1,7 @@
-from rest_framework import serializers
-from rest_framework.response import Response
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework import serializers
+from rest_framework.response import Response
 
 
 from misago.acl.objectacl import add_acl_to_obj
 from misago.acl.objectacl import add_acl_to_obj
 from misago.conf import settings
 from misago.conf import settings
@@ -15,9 +14,8 @@ from misago.threads.permissions import (
     allow_hide_post,
     allow_hide_post,
     allow_protect_post,
     allow_protect_post,
     allow_unhide_post,
     allow_unhide_post,
+    exclude_invisible_posts,
 )
 )
-from misago.threads.permissions import exclude_invisible_posts
-
 
 
 PATCH_LIMIT = settings.MISAGO_POSTS_PER_PAGE + settings.MISAGO_POSTS_TAIL
 PATCH_LIMIT = settings.MISAGO_POSTS_PER_PAGE + settings.MISAGO_POSTS_TAIL
 
 

+ 1 - 2
misago/threads/api/postendpoints/split.py

@@ -1,7 +1,6 @@
-from rest_framework.response import Response
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework.response import Response
 
 
 from misago.threads.models import Thread
 from misago.threads.models import Thread
 from misago.threads.moderation import threads as moderation
 from misago.threads.moderation import threads as moderation

+ 1 - 2
misago/threads/api/postingendpoint/attachments.py

@@ -1,7 +1,6 @@
-from rest_framework import serializers
-
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
 from django.utils.translation import ngettext
 from django.utils.translation import ngettext
+from rest_framework import serializers
 
 
 from misago.acl.objectacl import add_acl_to_obj
 from misago.acl.objectacl import add_acl_to_obj
 from misago.conf import settings
 from misago.conf import settings

+ 1 - 2
misago/threads/api/postingendpoint/category.py

@@ -1,8 +1,7 @@
-from rest_framework import serializers
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext_lazy
 from django.utils.translation import gettext_lazy
+from rest_framework import serializers
 
 
 from misago.acl.objectacl import add_acl_to_obj
 from misago.acl.objectacl import add_acl_to_obj
 from misago.categories import THREADS_ROOT_NAME
 from misago.categories import THREADS_ROOT_NAME

+ 0 - 1
misago/threads/api/postingendpoint/floodprotection.py

@@ -7,7 +7,6 @@ from misago.conf import settings
 
 
 from . import PostingEndpoint, PostingInterrupt, PostingMiddleware
 from . import PostingEndpoint, PostingInterrupt, PostingMiddleware
 
 
-
 MIN_POSTING_PAUSE = 3
 MIN_POSTING_PAUSE = 3
 
 
 
 

+ 3 - 4
misago/threads/api/postingendpoint/participants.py

@@ -1,8 +1,8 @@
-from rest_framework import serializers
-
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
-from django.utils.translation import gettext as _, ngettext
+from django.utils.translation import gettext as _
+from django.utils.translation import ngettext
+from rest_framework import serializers
 
 
 from misago.acl import useracl
 from misago.acl import useracl
 from misago.categories import PRIVATE_THREADS_ROOT_NAME
 from misago.categories import PRIVATE_THREADS_ROOT_NAME
@@ -11,7 +11,6 @@ from misago.threads.permissions import allow_message_user
 
 
 from . import PostingEndpoint, PostingMiddleware
 from . import PostingEndpoint, PostingMiddleware
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 1 - 2
misago/threads/api/postingendpoint/reply.py

@@ -1,6 +1,5 @@
-from rest_framework import serializers
-
 from django.utils.translation import gettext_lazy
 from django.utils.translation import gettext_lazy
+from rest_framework import serializers
 
 
 from misago.markup import common_flavour
 from misago.markup import common_flavour
 from misago.threads.checksums import update_post_checksum
 from misago.threads.checksums import update_post_checksum

+ 0 - 1
misago/threads/api/postingendpoint/subscribe.py

@@ -4,7 +4,6 @@ from misago.threads.models import Subscription
 
 
 from . import PostingEndpoint, PostingMiddleware
 from . import PostingEndpoint, PostingMiddleware
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 1 - 2
misago/threads/api/threadendpoints/delete.py

@@ -1,6 +1,5 @@
-from rest_framework.response import Response
-
 from django.db import transaction
 from django.db import transaction
+from rest_framework.response import Response
 
 
 from misago.threads.moderation import threads as moderation
 from misago.threads.moderation import threads as moderation
 from misago.threads.permissions import allow_delete_thread
 from misago.threads.permissions import allow_delete_thread

+ 1 - 2
misago/threads/api/threadendpoints/editor.py

@@ -1,7 +1,6 @@
-from rest_framework.response import Response
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework.response import Response
 
 
 from misago.acl.objectacl import add_acl_to_obj
 from misago.acl.objectacl import add_acl_to_obj
 from misago.categories import THREADS_ROOT_NAME
 from misago.categories import THREADS_ROOT_NAME

+ 2 - 3
misago/threads/api/threadendpoints/merge.py

@@ -1,8 +1,7 @@
-from rest_framework.exceptions import ValidationError
-from rest_framework.response import Response
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework.exceptions import ValidationError
+from rest_framework.response import Response
 
 
 from misago.acl.objectacl import add_acl_to_obj
 from misago.acl.objectacl import add_acl_to_obj
 from misago.threads.events import record_event
 from misago.threads.events import record_event

+ 3 - 4
misago/threads/api/threadendpoints/patch.py

@@ -1,11 +1,10 @@
-from rest_framework import serializers
-from rest_framework.response import Response
-
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
 from django.core.exceptions import PermissionDenied, ValidationError
 from django.core.exceptions import PermissionDenied, ValidationError
 from django.http import Http404
 from django.http import Http404
 from django.shortcuts import get_object_or_404
 from django.shortcuts import get_object_or_404
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework import serializers
+from rest_framework.response import Response
 
 
 from misago.acl import useracl
 from misago.acl import useracl
 from misago.acl.objectacl import add_acl_to_obj
 from misago.acl.objectacl import add_acl_to_obj
@@ -29,11 +28,11 @@ from misago.threads.permissions import (
     allow_change_best_answer,
     allow_change_best_answer,
     allow_change_owner,
     allow_change_owner,
     allow_edit_thread,
     allow_edit_thread,
-    allow_pin_thread,
     allow_hide_thread,
     allow_hide_thread,
     allow_mark_as_best_answer,
     allow_mark_as_best_answer,
     allow_mark_best_answer,
     allow_mark_best_answer,
     allow_move_thread,
     allow_move_thread,
+    allow_pin_thread,
     allow_remove_participant,
     allow_remove_participant,
     allow_see_post,
     allow_see_post,
     allow_start_thread,
     allow_start_thread,

+ 3 - 4
misago/threads/api/threadpoll.py

@@ -1,11 +1,10 @@
-from rest_framework import viewsets
-from rest_framework.decorators import detail_route
-from rest_framework.response import Response
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.db import transaction
 from django.db import transaction
 from django.http import Http404
 from django.http import Http404
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework import viewsets
+from rest_framework.decorators import detail_route
+from rest_framework.response import Response
 
 
 from misago.acl.objectacl import add_acl_to_obj
 from misago.acl.objectacl import add_acl_to_obj
 from misago.core.shortcuts import get_int_or_404
 from misago.core.shortcuts import get_int_or_404

+ 4 - 5
misago/threads/api/threadposts.py

@@ -1,10 +1,9 @@
-from rest_framework import viewsets
-from rest_framework.decorators import detail_route, list_route
-from rest_framework.response import Response
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.db import transaction
 from django.db import transaction
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework import viewsets
+from rest_framework.decorators import detail_route, list_route
+from rest_framework.response import Response
 
 
 from misago.acl.objectacl import add_acl_to_obj
 from misago.acl.objectacl import add_acl_to_obj
 from misago.core.shortcuts import get_int_or_404
 from misago.core.shortcuts import get_int_or_404
@@ -25,7 +24,7 @@ from .postendpoints.likes import likes_list_endpoint
 from .postendpoints.merge import posts_merge_endpoint
 from .postendpoints.merge import posts_merge_endpoint
 from .postendpoints.move import posts_move_endpoint
 from .postendpoints.move import posts_move_endpoint
 from .postendpoints.patch_event import event_patch_endpoint
 from .postendpoints.patch_event import event_patch_endpoint
-from .postendpoints.patch_post import post_patch_endpoint, bulk_patch_endpoint
+from .postendpoints.patch_post import bulk_patch_endpoint, post_patch_endpoint
 from .postendpoints.read import post_read_endpoint
 from .postendpoints.read import post_read_endpoint
 from .postendpoints.split import posts_split_endpoint
 from .postendpoints.split import posts_split_endpoint
 from .postingendpoint import PostingEndpoint
 from .postingendpoint import PostingEndpoint

+ 4 - 5
misago/threads/api/threads.py

@@ -1,10 +1,9 @@
-from rest_framework import viewsets
-from rest_framework.decorators import detail_route, list_route
-from rest_framework.response import Response
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.db import transaction
 from django.db import transaction
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework import viewsets
+from rest_framework.decorators import detail_route, list_route
+from rest_framework.response import Response
 
 
 from misago.categories import PRIVATE_THREADS_ROOT_NAME, THREADS_ROOT_NAME
 from misago.categories import PRIVATE_THREADS_ROOT_NAME, THREADS_ROOT_NAME
 from misago.core.shortcuts import get_int_or_404
 from misago.core.shortcuts import get_int_or_404
@@ -14,8 +13,8 @@ from misago.threads.permissions import allow_use_private_threads
 from misago.threads.viewmodels import (
 from misago.threads.viewmodels import (
     ForumThread,
     ForumThread,
     PrivateThread,
     PrivateThread,
-    ThreadsRootCategory,
     PrivateThreadsCategory,
     PrivateThreadsCategory,
+    ThreadsRootCategory,
 )
 )
 
 
 from .postingendpoint import PostingEndpoint
 from .postingendpoint import PostingEndpoint

+ 0 - 1
misago/threads/filtersearch.py

@@ -2,7 +2,6 @@ from django.utils.module_loading import import_string
 
 
 from misago.conf import settings
 from misago.conf import settings
 
 
-
 filters_list = settings.MISAGO_POST_SEARCH_FILTERS
 filters_list = settings.MISAGO_POST_SEARCH_FILTERS
 SEARCH_FILTERS = list(map(import_string, filters_list))
 SEARCH_FILTERS = list(map(import_string, filters_list))
 
 

+ 1 - 2
misago/threads/mergeconflict.py

@@ -1,6 +1,5 @@
-from rest_framework.exceptions import ValidationError
-
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework.exceptions import ValidationError
 
 
 from misago.threads.models import Poll
 from misago.threads.models import Poll
 
 

+ 0 - 1
misago/threads/migrations/0002_threads_settings.py

@@ -2,7 +2,6 @@ from django.db import migrations
 
 
 from misago.conf.migrationutils import migrate_settings_group
 from misago.conf.migrationutils import migrate_settings_group
 
 
-
 _ = lambda s: s
 _ = lambda s: s
 
 
 
 

+ 0 - 1
misago/threads/migrations/0003_attachment_types.py

@@ -1,7 +1,6 @@
 # Generated by Django 1.9.7 on 2016-10-04 21:41
 # Generated by Django 1.9.7 on 2016-10-04 21:41
 from django.db import migrations
 from django.db import migrations
 
 
-
 ATTACHMENTS = [
 ATTACHMENTS = [
     {
     {
         "name": "GIF",
         "name": "GIF",

+ 1 - 1
misago/threads/migrations/0008_auto_20180310_2234.py

@@ -1,7 +1,7 @@
 # Generated by Django 1.11.9 on 2018-03-10 22:34
 # Generated by Django 1.11.9 on 2018-03-10 22:34
+import django.db.models.deletion
 from django.conf import settings
 from django.conf import settings
 from django.db import migrations, models
 from django.db import migrations, models
-import django.db.models.deletion
 
 
 
 
 class Migration(migrations.Migration):
 class Migration(migrations.Migration):

+ 1 - 2
misago/threads/models/attachment.py

@@ -2,14 +2,13 @@ import os
 from hashlib import md5
 from hashlib import md5
 from io import BytesIO
 from io import BytesIO
 
 
-from PIL import Image
-
 from django.core.files import File
 from django.core.files import File
 from django.core.files.base import ContentFile
 from django.core.files.base import ContentFile
 from django.db import models
 from django.db import models
 from django.urls import reverse
 from django.urls import reverse
 from django.utils import timezone
 from django.utils import timezone
 from django.utils.crypto import get_random_string
 from django.utils.crypto import get_random_string
+from PIL import Image
 
 
 from misago.conf import settings
 from misago.conf import settings
 from misago.core.utils import slugify
 from misago.core.utils import slugify

+ 1 - 1
misago/threads/models/post.py

@@ -1,7 +1,7 @@
 import copy
 import copy
 
 
-from django.contrib.postgres.indexes import GinIndex
 from django.contrib.postgres.fields import JSONField
 from django.contrib.postgres.fields import JSONField
+from django.contrib.postgres.indexes import GinIndex
 from django.contrib.postgres.search import SearchVector, SearchVectorField
 from django.contrib.postgres.search import SearchVector, SearchVectorField
 from django.db import models
 from django.db import models
 from django.utils import timezone
 from django.utils import timezone

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

@@ -4,7 +4,6 @@ from django.utils.translation import gettext as _
 
 
 from .exceptions import ModerationError
 from .exceptions import ModerationError
 
 
-
 __all__ = [
 __all__ = [
     "approve_post",
     "approve_post",
     "protect_post",
     "protect_post",

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

@@ -3,7 +3,6 @@ from django.utils import timezone
 
 
 from misago.threads.events import record_event
 from misago.threads.events import record_event
 
 
-
 __all__ = [
 __all__ = [
     "change_thread_title",
     "change_thread_title",
     "pin_thread_globally",
     "pin_thread_globally",

+ 0 - 1
misago/threads/participants.py

@@ -6,7 +6,6 @@ from misago.core.mail import build_mail, send_messages
 from .events import record_event
 from .events import record_event
 from .models import ThreadParticipant
 from .models import ThreadParticipant
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 0 - 1
misago/threads/permissions/attachments.py

@@ -6,7 +6,6 @@ from misago.acl.models import Role
 from misago.admin.forms import YesNoSwitch
 from misago.admin.forms import YesNoSwitch
 from misago.threads.models import Attachment
 from misago.threads.models import Attachment
 
 
-
 # Admin Permissions Forms
 # Admin Permissions Forms
 class PermissionsForm(forms.Form):
 class PermissionsForm(forms.Form):
     legend = _("Attachments")
     legend = _("Attachments")

+ 2 - 2
misago/threads/permissions/bestanswers.py

@@ -1,7 +1,8 @@
 from django import forms
 from django import forms
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.utils import timezone
 from django.utils import timezone
-from django.utils.translation import gettext_lazy as _, ngettext
+from django.utils.translation import gettext_lazy as _
+from django.utils.translation import ngettext
 
 
 from misago.acl import algebra
 from misago.acl import algebra
 from misago.acl.decorators import return_boolean
 from misago.acl.decorators import return_boolean
@@ -10,7 +11,6 @@ from misago.categories.models import Category, CategoryRole
 from misago.categories.permissions import get_categories_roles
 from misago.categories.permissions import get_categories_roles
 from misago.threads.models import Post, Thread
 from misago.threads.models import Post, Thread
 
 
-
 __all__nope = [
 __all__nope = [
     "allow_mark_best_answer",
     "allow_mark_best_answer",
     "can_mark_best_answer",
     "can_mark_best_answer",

+ 0 - 1
misago/threads/permissions/polls.py

@@ -10,7 +10,6 @@ from misago.acl.models import Role
 from misago.admin.forms import YesNoSwitch
 from misago.admin.forms import YesNoSwitch
 from misago.threads.models import Poll, Thread
 from misago.threads.models import Poll, Thread
 
 
-
 __all__ = [
 __all__ = [
     "allow_start_poll",
     "allow_start_poll",
     "can_start_poll",
     "can_start_poll",

+ 0 - 1
misago/threads/permissions/privatethreads.py

@@ -11,7 +11,6 @@ from misago.categories import PRIVATE_THREADS_ROOT_NAME
 from misago.categories.models import Category
 from misago.categories.models import Category
 from misago.threads.models import Thread
 from misago.threads.models import Thread
 
 
-
 __all__ = [
 __all__ = [
     "allow_use_private_threads",
     "allow_use_private_threads",
     "can_use_private_threads",
     "can_use_private_threads",

+ 2 - 2
misago/threads/permissions/threads.py

@@ -3,7 +3,8 @@ from django.core.exceptions import PermissionDenied
 from django.db.models import Q
 from django.db.models import Q
 from django.http import Http404
 from django.http import Http404
 from django.utils import timezone
 from django.utils import timezone
-from django.utils.translation import gettext_lazy as _, ngettext
+from django.utils.translation import gettext_lazy as _
+from django.utils.translation import ngettext
 
 
 from misago.acl import algebra
 from misago.acl import algebra
 from misago.acl.decorators import return_boolean
 from misago.acl.decorators import return_boolean
@@ -14,7 +15,6 @@ from misago.categories.models import Category, CategoryRole
 from misago.categories.permissions import get_categories_roles
 from misago.categories.permissions import get_categories_roles
 from misago.threads.models import Post, Thread
 from misago.threads.models import Post, Thread
 
 
-
 __all__ = [
 __all__ = [
     "allow_see_thread",
     "allow_see_thread",
     "can_see_thread",
     "can_see_thread",

+ 0 - 1
misago/threads/search.py

@@ -12,7 +12,6 @@ from .serializers import FeedSerializer
 from .utils import add_categories_to_items
 from .utils import add_categories_to_items
 from .viewmodels import ThreadsRootCategory
 from .viewmodels import ThreadsRootCategory
 
 
-
 HITS_CEILING = settings.MISAGO_POSTS_PER_PAGE * 5
 HITS_CEILING = settings.MISAGO_POSTS_PER_PAGE * 5
 
 
 
 

+ 1 - 3
misago/threads/serializers/attachment.py

@@ -1,10 +1,8 @@
-from rest_framework import serializers
-
 from django.urls import reverse
 from django.urls import reverse
+from rest_framework import serializers
 
 
 from misago.threads.models import Attachment
 from misago.threads.models import Attachment
 
 
-
 __all__ = ["AttachmentSerializer"]
 __all__ = ["AttachmentSerializer"]
 
 
 
 

+ 0 - 1
misago/threads/serializers/feed.py

@@ -7,7 +7,6 @@ from misago.users.serializers import UserSerializer
 
 
 from .post import PostSerializer
 from .post import PostSerializer
 
 
-
 __all__ = ["FeedSerializer"]
 __all__ = ["FeedSerializer"]
 
 
 FeedUserSerializer = UserSerializer.subset_fields(
 FeedUserSerializer = UserSerializer.subset_fields(

+ 3 - 4
misago/threads/serializers/moderation.py

@@ -1,8 +1,8 @@
-from rest_framework import serializers
-
 from django.core.exceptions import PermissionDenied, ValidationError
 from django.core.exceptions import PermissionDenied, ValidationError
 from django.http import Http404
 from django.http import Http404
-from django.utils.translation import gettext as _, gettext_lazy, ngettext
+from django.utils.translation import gettext as _
+from django.utils.translation import gettext_lazy, ngettext
+from rest_framework import serializers
 
 
 from misago.acl.objectacl import add_acl_to_obj
 from misago.acl.objectacl import add_acl_to_obj
 from misago.categories import THREADS_ROOT_NAME
 from misago.categories import THREADS_ROOT_NAME
@@ -27,7 +27,6 @@ from misago.threads.threadtypes import trees_map
 from misago.threads.utils import get_thread_id_from_url
 from misago.threads.utils import get_thread_id_from_url
 from misago.threads.validators import validate_category, validate_thread_title
 from misago.threads.validators import validate_category, validate_thread_title
 
 
-
 POSTS_LIMIT = settings.MISAGO_POSTS_PER_PAGE + settings.MISAGO_POSTS_TAIL
 POSTS_LIMIT = settings.MISAGO_POSTS_PER_PAGE + settings.MISAGO_POSTS_TAIL
 THREADS_LIMIT = settings.MISAGO_THREADS_PER_PAGE + settings.MISAGO_THREADS_TAIL
 THREADS_LIMIT = settings.MISAGO_THREADS_PER_PAGE + settings.MISAGO_THREADS_TAIL
 
 

+ 1 - 3
misago/threads/serializers/poll.py

@@ -1,13 +1,11 @@
-from rest_framework import serializers
-
 from django.urls import reverse
 from django.urls import reverse
 from django.utils.crypto import get_random_string
 from django.utils.crypto import get_random_string
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
 from django.utils.translation import ngettext
 from django.utils.translation import ngettext
+from rest_framework import serializers
 
 
 from misago.threads.models import Poll
 from misago.threads.models import Poll
 
 
-
 __all__ = [
 __all__ = [
     "PollSerializer",
     "PollSerializer",
     "EditPollSerializer",
     "EditPollSerializer",

+ 1 - 3
misago/threads/serializers/pollvote.py

@@ -1,9 +1,7 @@
-from rest_framework import serializers
-
 from django.urls import reverse
 from django.urls import reverse
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
 from django.utils.translation import ngettext
 from django.utils.translation import ngettext
-
+from rest_framework import serializers
 
 
 __all__ = ["NewVoteSerializer", "PollVoteSerializer"]
 __all__ = ["NewVoteSerializer", "PollVoteSerializer"]
 
 

+ 1 - 3
misago/threads/serializers/post.py

@@ -1,12 +1,10 @@
-from rest_framework import serializers
-
 from django.urls import reverse
 from django.urls import reverse
+from rest_framework import serializers
 
 
 from misago.core.serializers import MutableFields
 from misago.core.serializers import MutableFields
 from misago.threads.models import Post
 from misago.threads.models import Post
 from misago.users.serializers import UserSerializer as BaseUserSerializer
 from misago.users.serializers import UserSerializer as BaseUserSerializer
 
 
-
 __all__ = ["PostSerializer"]
 __all__ = ["PostSerializer"]
 
 
 UserSerializer = BaseUserSerializer.subset_fields(
 UserSerializer = BaseUserSerializer.subset_fields(

+ 1 - 3
misago/threads/serializers/postedit.py

@@ -1,10 +1,8 @@
-from rest_framework import serializers
-
 from django.urls import reverse
 from django.urls import reverse
+from rest_framework import serializers
 
 
 from misago.threads.models import PostEdit
 from misago.threads.models import PostEdit
 
 
-
 __all__ = ["PostEditSerializer"]
 __all__ = ["PostEditSerializer"]
 
 
 
 

+ 1 - 3
misago/threads/serializers/postlike.py

@@ -1,10 +1,8 @@
-from rest_framework import serializers
-
 from django.urls import reverse
 from django.urls import reverse
+from rest_framework import serializers
 
 
 from misago.threads.models import PostLike
 from misago.threads.models import PostLike
 
 
-
 __all__ = ["PostLikeSerializer"]
 __all__ = ["PostLikeSerializer"]
 
 
 
 

+ 1 - 3
misago/threads/serializers/thread.py

@@ -1,6 +1,5 @@
-from rest_framework import serializers
-
 from django.urls import reverse
 from django.urls import reverse
+from rest_framework import serializers
 
 
 from misago.categories.serializers import CategorySerializer
 from misago.categories.serializers import CategorySerializer
 from misago.core.serializers import MutableFields
 from misago.core.serializers import MutableFields
@@ -9,7 +8,6 @@ from misago.threads.models import Thread
 from .poll import PollSerializer
 from .poll import PollSerializer
 from .threadparticipant import ThreadParticipantSerializer
 from .threadparticipant import ThreadParticipantSerializer
 
 
-
 __all__ = ["ThreadSerializer", "PrivateThreadSerializer", "ThreadsListSerializer"]
 __all__ = ["ThreadSerializer", "PrivateThreadSerializer", "ThreadsListSerializer"]
 
 
 BasicCategorySerializer = CategorySerializer.subset_fields(
 BasicCategorySerializer = CategorySerializer.subset_fields(

+ 0 - 1
misago/threads/serializers/threadparticipant.py

@@ -2,7 +2,6 @@ from rest_framework import serializers
 
 
 from misago.threads.models import ThreadParticipant
 from misago.threads.models import ThreadParticipant
 
 
-
 __all__ = ["ThreadParticipantSerializer"]
 __all__ = ["ThreadParticipantSerializer"]
 
 
 
 

+ 0 - 1
misago/threads/signals.py

@@ -19,7 +19,6 @@ from misago.users.signals import (
 from .anonymize import ANONYMIZABLE_EVENTS, anonymize_event, anonymize_post_last_likes
 from .anonymize import ANONYMIZABLE_EVENTS, anonymize_event, anonymize_post_last_likes
 from .models import Attachment, Poll, PollVote, Post, PostEdit, PostLike, Thread
 from .models import Attachment, Poll, PollVote, Post, PostEdit, PostLike, Thread
 
 
-
 delete_post = Signal()
 delete_post = Signal()
 delete_thread = Signal()
 delete_thread = Signal()
 merge_post = Signal(providing_args=["other_post"])
 merge_post = Signal(providing_args=["other_post"])

+ 0 - 1
misago/threads/templatetags/misago_poststags.py

@@ -2,7 +2,6 @@ from django import template
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
 from django.utils.translation import ngettext
 from django.utils.translation import ngettext
 
 
-
 register = template.Library()
 register = template.Library()
 
 
 
 

+ 1 - 3
misago/threads/tests/test_anonymize_data.py

@@ -4,8 +4,6 @@ from django.urls import reverse
 from misago.cache.versions import get_cache_versions
 from misago.cache.versions import get_cache_versions
 from misago.categories.models import Category
 from misago.categories.models import Category
 from misago.conf.dynamicsettings import DynamicSettings
 from misago.conf.dynamicsettings import DynamicSettings
-from misago.users.test import AuthenticatedUserTestCase
-
 from misago.threads import test
 from misago.threads import test
 from misago.threads.api.postendpoints.patch_post import patch_is_liked
 from misago.threads.api.postendpoints.patch_post import patch_is_liked
 from misago.threads.models import Post
 from misago.threads.models import Post
@@ -16,7 +14,7 @@ from misago.threads.participants import (
     remove_participant,
     remove_participant,
     set_owner,
     set_owner,
 )
 )
-from misago.users.test import create_test_user
+from misago.users.test import AuthenticatedUserTestCase, create_test_user
 
 
 
 
 class AnonymizeEventsTests(AuthenticatedUserTestCase):
 class AnonymizeEventsTests(AuthenticatedUserTestCase):

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

@@ -1,8 +1,7 @@
 import os
 import os
 
 
-from PIL import Image
-
 from django.urls import reverse
 from django.urls import reverse
+from PIL import Image
 
 
 from misago.acl.models import Role
 from misago.acl.models import Role
 from misago.acl.test import patch_user_acl
 from misago.acl.test import patch_user_acl

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

@@ -1,11 +1,10 @@
 from django.test import RequestFactory
 from django.test import RequestFactory
 
 
 from misago.categories.models import Category
 from misago.categories.models import Category
-from misago.users.test import AuthenticatedUserTestCase, create_test_user
-
 from misago.threads import test
 from misago.threads import test
 from misago.threads.api.postendpoints.patch_post import patch_is_liked
 from misago.threads.api.postendpoints.patch_post import patch_is_liked
 from misago.threads.models import Post
 from misago.threads.models import Post
+from misago.users.test import AuthenticatedUserTestCase, create_test_user
 
 
 
 
 class DeleteUserLikesTests(AuthenticatedUserTestCase):
 class DeleteUserLikesTests(AuthenticatedUserTestCase):

+ 0 - 1
misago/threads/tests/test_gotoviews.py

@@ -7,7 +7,6 @@ from misago.threads import test
 from misago.threads.test import patch_category_acl
 from misago.threads.test import patch_category_acl
 from misago.users.test import AuthenticatedUserTestCase
 from misago.users.test import AuthenticatedUserTestCase
 
 
-
 GOTO_URL = "%s#post-%s"
 GOTO_URL = "%s#post-%s"
 GOTO_PAGE_URL = "%s%s/#post-%s"
 GOTO_PAGE_URL = "%s%s/#post-%s"
 
 

+ 1 - 3
misago/threads/tests/test_mergeconflict.py

@@ -1,9 +1,7 @@
-from rest_framework.exceptions import ValidationError
-
 from django.test import TestCase
 from django.test import TestCase
+from rest_framework.exceptions import ValidationError
 
 
 from misago.categories.models import Category
 from misago.categories.models import Category
-
 from misago.threads import test
 from misago.threads import test
 from misago.threads.mergeconflict import MergeConflict
 from misago.threads.mergeconflict import MergeConflict
 from misago.users.test import create_test_user
 from misago.users.test import create_test_user

+ 1 - 1
misago/threads/tests/test_privatethread_patch_api.py

@@ -4,8 +4,8 @@ from django.core import mail
 
 
 from misago.acl.test import patch_user_acl
 from misago.acl.test import patch_user_acl
 from misago.threads import test
 from misago.threads import test
-from misago.threads.test import other_user_cant_use_private_threads
 from misago.threads.models import Thread, ThreadParticipant
 from misago.threads.models import Thread, ThreadParticipant
+from misago.threads.test import other_user_cant_use_private_threads
 from misago.users.test import create_test_user
 from misago.users.test import create_test_user
 
 
 from .test_privatethreads import PrivateThreadsTestCase
 from .test_privatethreads import PrivateThreadsTestCase

+ 0 - 1
misago/threads/tests/test_subscription_middleware.py

@@ -7,7 +7,6 @@ from misago.threads import test
 from misago.threads.test import patch_category_acl
 from misago.threads.test import patch_category_acl
 from misago.users.test import AuthenticatedUserTestCase
 from misago.users.test import AuthenticatedUserTestCase
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 1 - 1
misago/threads/tests/test_thread_patch_api.py

@@ -6,8 +6,8 @@ from django.utils import timezone
 from misago.categories.models import Category
 from misago.categories.models import Category
 from misago.readtracker import poststracker
 from misago.readtracker import poststracker
 from misago.threads import test
 from misago.threads import test
-from misago.threads.test import patch_category_acl, patch_other_category_acl
 from misago.threads.models import Thread
 from misago.threads.models import Thread
+from misago.threads.test import patch_category_acl, patch_other_category_acl
 
 
 from .test_threads_api import ThreadsApiTestCase
 from .test_threads_api import ThreadsApiTestCase
 
 

+ 1 - 1
misago/threads/tests/test_thread_postlikes_api.py

@@ -1,8 +1,8 @@
 from django.urls import reverse
 from django.urls import reverse
 
 
 from misago.threads import test
 from misago.threads import test
-from misago.threads.test import patch_category_acl
 from misago.threads.serializers import PostLikeSerializer
 from misago.threads.serializers import PostLikeSerializer
+from misago.threads.test import patch_category_acl
 
 
 from .test_threads_api import ThreadsApiTestCase
 from .test_threads_api import ThreadsApiTestCase
 
 

+ 1 - 1
misago/threads/tests/test_thread_postpatch_api.py

@@ -6,7 +6,7 @@ from django.utils import timezone
 
 
 from misago.categories.models import Category
 from misago.categories.models import Category
 from misago.threads import test
 from misago.threads import test
-from misago.threads.models import Thread, Post
+from misago.threads.models import Post, Thread
 from misago.threads.test import patch_category_acl
 from misago.threads.test import patch_category_acl
 from misago.users.test import AuthenticatedUserTestCase
 from misago.users.test import AuthenticatedUserTestCase
 
 

+ 1 - 1
misago/threads/tests/test_threads_api.py

@@ -1,7 +1,7 @@
 from datetime import timedelta
 from datetime import timedelta
 
 
-from django.utils import timezone
 from django.urls import reverse
 from django.urls import reverse
+from django.utils import timezone
 
 
 from misago.categories import THREADS_ROOT_NAME
 from misago.categories import THREADS_ROOT_NAME
 from misago.categories.models import Category
 from misago.categories.models import Category

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

@@ -8,8 +8,8 @@ from misago.conftest import get_cache_versions
 from misago.threads import test
 from misago.threads import test
 from misago.threads.checksums import update_post_checksum
 from misago.threads.checksums import update_post_checksum
 from misago.threads.events import record_event
 from misago.threads.events import record_event
-from misago.threads.moderation import threads as threads_moderation
 from misago.threads.moderation import hide_post
 from misago.threads.moderation import hide_post
+from misago.threads.moderation import threads as threads_moderation
 from misago.users.test import AuthenticatedUserTestCase
 from misago.users.test import AuthenticatedUserTestCase
 
 
 cache_versions = get_cache_versions()
 cache_versions = get_cache_versions()

+ 0 - 1
misago/threads/tests/test_treesmap.py

@@ -3,7 +3,6 @@ from django.test import TestCase
 from misago.categories.models import Category
 from misago.categories.models import Category
 from misago.threads.threadtypes.treesmap import TreesMap
 from misago.threads.threadtypes.treesmap import TreesMap
 
 
-
 THREAD_TYPE = "misago.threads.threadtypes.thread.Thread"
 THREAD_TYPE = "misago.threads.threadtypes.thread.Thread"
 
 
 
 

+ 0 - 1
misago/threads/urls/api.py

@@ -4,7 +4,6 @@ from misago.threads.api.threadpoll import ThreadPollViewSet
 from misago.threads.api.threadposts import PrivateThreadPostsViewSet, ThreadPostsViewSet
 from misago.threads.api.threadposts import PrivateThreadPostsViewSet, ThreadPostsViewSet
 from misago.threads.api.threads import PrivateThreadViewSet, ThreadViewSet
 from misago.threads.api.threads import PrivateThreadViewSet, ThreadViewSet
 
 
-
 router = MisagoApiRouter()
 router = MisagoApiRouter()
 
 
 router.register(r"attachments", AttachmentViewSet, base_name="attachment")
 router.register(r"attachments", AttachmentViewSet, base_name="attachment")

+ 0 - 1
misago/threads/viewmodels/category.py

@@ -8,7 +8,6 @@ from misago.core.shortcuts import validate_slug
 from misago.core.viewmodel import ViewModel as BaseViewModel
 from misago.core.viewmodel import ViewModel as BaseViewModel
 from misago.threads.permissions import allow_use_private_threads
 from misago.threads.permissions import allow_use_private_threads
 
 
-
 __all__ = ["ThreadsRootCategory", "ThreadsCategory", "PrivateThreadsCategory"]
 __all__ = ["ThreadsRootCategory", "ThreadsCategory", "PrivateThreadsCategory"]
 
 
 
 

+ 0 - 1
misago/threads/viewmodels/post.py

@@ -4,7 +4,6 @@ from misago.acl.objectacl import add_acl_to_obj
 from misago.core.viewmodel import ViewModel as BaseViewModel
 from misago.core.viewmodel import ViewModel as BaseViewModel
 from misago.threads.permissions import exclude_invisible_posts
 from misago.threads.permissions import exclude_invisible_posts
 
 
-
 __all__ = ["ThreadPost"]
 __all__ = ["ThreadPost"]
 
 
 
 

+ 0 - 1
misago/threads/viewmodels/posts.py

@@ -8,7 +8,6 @@ from misago.threads.serializers import PostSerializer
 from misago.threads.utils import add_likes_to_posts
 from misago.threads.utils import add_likes_to_posts
 from misago.users.online.utils import make_users_status_aware
 from misago.users.online.utils import make_users_status_aware
 
 
-
 __all__ = ["ThreadPosts"]
 __all__ = ["ThreadPosts"]
 
 
 
 

+ 0 - 1
misago/threads/viewmodels/thread.py

@@ -18,7 +18,6 @@ from misago.threads.serializers import PrivateThreadSerializer, ThreadSerializer
 from misago.threads.subscriptions import make_subscription_aware
 from misago.threads.subscriptions import make_subscription_aware
 from misago.threads.threadtypes import trees_map
 from misago.threads.threadtypes import trees_map
 
 
-
 __all__ = ["ForumThread", "PrivateThread"]
 __all__ = ["ForumThread", "PrivateThread"]
 
 
 BASE_RELATIONS = [
 BASE_RELATIONS = [

+ 0 - 1
misago/threads/views/attachment.py

@@ -5,7 +5,6 @@ from django.shortcuts import get_object_or_404, redirect
 from misago.conf import settings
 from misago.conf import settings
 from misago.threads.models import Attachment, AttachmentType
 from misago.threads.models import Attachment, AttachmentType
 
 
-
 ATTACHMENT_404_URL = "".join((settings.STATIC_URL, settings.MISAGO_404_IMAGE))
 ATTACHMENT_404_URL = "".join((settings.STATIC_URL, settings.MISAGO_404_IMAGE))
 ATTACHMENT_403_URL = "".join((settings.STATIC_URL, settings.MISAGO_403_IMAGE))
 ATTACHMENT_403_URL = "".join((settings.STATIC_URL, settings.MISAGO_403_IMAGE))
 
 

+ 0 - 1
misago/urls.py

@@ -4,7 +4,6 @@ from django.views.generic import TemplateView
 from misago.conf import settings
 from misago.conf import settings
 from misago.core.views import forum_index
 from misago.core.views import forum_index
 
 
-
 app_name = "misago"
 app_name = "misago"
 
 
 # Register Misago Apps
 # Register Misago Apps

+ 0 - 1
misago/users/activepostersranking.py

@@ -9,7 +9,6 @@ from misago.conf import settings
 
 
 from .models import ActivityRanking
 from .models import ActivityRanking
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 0 - 1
misago/users/admin.py

@@ -25,7 +25,6 @@ from .views.admin.users import (
     UsersList,
     UsersList,
 )
 )
 
 
-
 djadmin.site.register(model_or_iterable=get_user_model(), admin_class=UserAdminModel)
 djadmin.site.register(model_or_iterable=get_user_model(), admin_class=UserAdminModel)
 
 
 
 

+ 3 - 5
misago/users/api/auth.py

@@ -1,12 +1,11 @@
-from rest_framework import status
-from rest_framework.decorators import api_view, permission_classes
-from rest_framework.response import Response
-
 from django.contrib import auth
 from django.contrib import auth
 from django.contrib.auth.password_validation import validate_password
 from django.contrib.auth.password_validation import validate_password
 from django.core.exceptions import ValidationError
 from django.core.exceptions import ValidationError
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
 from django.views.decorators.csrf import csrf_protect
 from django.views.decorators.csrf import csrf_protect
+from rest_framework import status
+from rest_framework.decorators import api_view, permission_classes
+from rest_framework.response import Response
 
 
 from misago.conf import settings
 from misago.conf import settings
 from misago.core.decorators import require_dict_data
 from misago.core.decorators import require_dict_data
@@ -29,7 +28,6 @@ from misago.users.tokens import (
 
 
 from .rest_permissions import UnbannedAnonOnly, UnbannedOnly
 from .rest_permissions import UnbannedAnonOnly, UnbannedOnly
 
 
-
 User = auth.get_user_model()
 User = auth.get_user_model()
 
 
 
 

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

@@ -1,8 +1,7 @@
+from django.http import Http404
 from rest_framework.decorators import api_view
 from rest_framework.decorators import api_view
 from rest_framework.response import Response
 from rest_framework.response import Response
 
 
-from django.http import Http404
-
 
 
 @api_view()
 @api_view()
 def question(request):
 def question(request):

+ 2 - 4
misago/users/api/mention.py

@@ -1,12 +1,10 @@
-from rest_framework.decorators import api_view
-from rest_framework.response import Response
-
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
 from django.contrib.staticfiles.templatetags.staticfiles import static
 from django.contrib.staticfiles.templatetags.staticfiles import static
+from rest_framework.decorators import api_view
+from rest_framework.response import Response
 
 
 from misago.conf import settings
 from misago.conf import settings
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

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

@@ -1,7 +1,6 @@
-from rest_framework.permissions import BasePermission
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework.permissions import BasePermission
 
 
 from misago.core.exceptions import Banned
 from misago.core.exceptions import Banned
 from misago.users.bans import get_request_ip_ban
 from misago.users.bans import get_request_ip_ban

+ 2 - 3
misago/users/api/userendpoints/avatar.py

@@ -1,10 +1,9 @@
 import json
 import json
 
 
-from rest_framework import status
-from rest_framework.response import Response
-
 from django.core.exceptions import ValidationError
 from django.core.exceptions import ValidationError
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework import status
+from rest_framework.response import Response
 
 
 from misago.conf import settings
 from misago.conf import settings
 from misago.core.decorators import require_dict_data
 from misago.core.decorators import require_dict_data

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

@@ -1,8 +1,7 @@
+from django.utils.translation import gettext as _
 from rest_framework import status
 from rest_framework import status
 from rest_framework.response import Response
 from rest_framework.response import Response
 
 
-from django.utils.translation import gettext as _
-
 from misago.conf import settings
 from misago.conf import settings
 from misago.core.mail import mail_user
 from misago.core.mail import mail_user
 from misago.users.credentialchange import store_new_credential
 from misago.users.credentialchange import store_new_credential

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

@@ -1,8 +1,7 @@
+from django.utils.translation import gettext as _
 from rest_framework import status
 from rest_framework import status
 from rest_framework.response import Response
 from rest_framework.response import Response
 
 
-from django.utils.translation import gettext as _
-
 from misago.core.mail import mail_user
 from misago.core.mail import mail_user
 from misago.users.credentialchange import store_new_credential
 from misago.users.credentialchange import store_new_credential
 from misago.users.serializers import ChangePasswordSerializer
 from misago.users.serializers import ChangePasswordSerializer

+ 2 - 3
misago/users/api/userendpoints/create.py

@@ -1,11 +1,10 @@
-from rest_framework import status
-from rest_framework.response import Response
-
 from django.contrib.auth import authenticate, get_user_model, login
 from django.contrib.auth import authenticate, get_user_model, login
 from django.core.exceptions import PermissionDenied, ValidationError
 from django.core.exceptions import PermissionDenied, ValidationError
 from django.db import IntegrityError
 from django.db import IntegrityError
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
 from django.views.decorators.csrf import csrf_protect
 from django.views.decorators.csrf import csrf_protect
+from rest_framework import status
+from rest_framework.response import Response
 
 
 from misago.conf import settings
 from misago.conf import settings
 from misago.legal.models import Agreement
 from misago.legal.models import Agreement

+ 1 - 3
misago/users/api/userendpoints/editdetails.py

@@ -1,7 +1,5 @@
-from rest_framework.response import Response
-
 from django import forms
 from django import forms
-
+from rest_framework.response import Response
 
 
 from misago.users.profilefields import profilefields, serialize_profilefields_data
 from misago.users.profilefields import profilefields, serialize_profilefields_data
 
 

+ 1 - 3
misago/users/api/userendpoints/list.py

@@ -1,14 +1,12 @@
-from rest_framework.response import Response
-
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
 from django.shortcuts import get_object_or_404
 from django.shortcuts import get_object_or_404
+from rest_framework.response import Response
 
 
 from misago.core.shortcuts import get_int_or_404
 from misago.core.shortcuts import get_int_or_404
 from misago.users.models import Rank
 from misago.users.models import Rank
 from misago.users.serializers import UserCardSerializer
 from misago.users.serializers import UserCardSerializer
 from misago.users.viewmodels import ActivePosters, RankUsers
 from misago.users.viewmodels import ActivePosters, RankUsers
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 2 - 3
misago/users/api/userendpoints/signature.py

@@ -1,8 +1,7 @@
-from rest_framework import status
-from rest_framework.response import Response
-
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework import status
+from rest_framework.response import Response
 
 
 from misago.core.utils import format_plaintext_for_html
 from misago.core.utils import format_plaintext_for_html
 from misago.users.serializers import EditSignatureSerializer
 from misago.users.serializers import EditSignatureSerializer

+ 2 - 3
misago/users/api/userendpoints/username.py

@@ -1,8 +1,7 @@
-from rest_framework import status
-from rest_framework.response import Response
-
 from django.db import IntegrityError
 from django.db import IntegrityError
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework import status
+from rest_framework.response import Response
 
 
 from misago.users.namechanges import get_username_options
 from misago.users.namechanges import get_username_options
 from misago.users.serializers import ChangeUsernameSerializer
 from misago.users.serializers import ChangeUsernameSerializer

+ 2 - 4
misago/users/api/usernamechanges.py

@@ -1,11 +1,10 @@
-from rest_framework import viewsets
-from rest_framework.response import Response
-
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.db.models import Q
 from django.db.models import Q
 from django.shortcuts import get_object_or_404
 from django.shortcuts import get_object_or_404
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework import viewsets
+from rest_framework.response import Response
 
 
 from misago.core.shortcuts import get_int_or_404, paginate, pagination_dict
 from misago.core.shortcuts import get_int_or_404, paginate, pagination_dict
 from misago.users.models import UsernameChange
 from misago.users.models import UsernameChange
@@ -13,7 +12,6 @@ from misago.users.serializers import UsernameChangeSerializer
 
 
 from .rest_permissions import BasePermission
 from .rest_permissions import BasePermission
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 4 - 6
misago/users/api/users.py

@@ -1,8 +1,3 @@
-from rest_framework import status, viewsets
-from rest_framework.decorators import detail_route
-from rest_framework.parsers import FormParser, JSONParser, MultiPartParser
-from rest_framework.response import Response
-
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.db import transaction
 from django.db import transaction
@@ -10,6 +5,10 @@ from django.db.models import F
 from django.http import Http404
 from django.http import Http404
 from django.shortcuts import get_object_or_404
 from django.shortcuts import get_object_or_404
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework import status, viewsets
+from rest_framework.decorators import detail_route
+from rest_framework.parsers import FormParser, JSONParser, MultiPartParser
+from rest_framework.response import Response
 
 
 from misago.acl.objectacl import add_acl_to_obj
 from misago.acl.objectacl import add_acl_to_obj
 from misago.categories.models import Category
 from misago.categories.models import Category
@@ -52,7 +51,6 @@ from .userendpoints.list import list_endpoint
 from .userendpoints.signature import signature_endpoint
 from .userendpoints.signature import signature_endpoint
 from .userendpoints.username import moderate_username_endpoint, username_endpoint
 from .userendpoints.username import moderate_username_endpoint, username_endpoint
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 0 - 1
misago/users/authbackends.py

@@ -1,7 +1,6 @@
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
 from django.contrib.auth.backends import ModelBackend
 from django.contrib.auth.backends import ModelBackend
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 1 - 3
misago/users/avatars/dynamic.py

@@ -1,14 +1,12 @@
 import os
 import os
 
 
-from PIL import Image, ImageColor, ImageDraw, ImageFont
-
 from django.utils.module_loading import import_string
 from django.utils.module_loading import import_string
+from PIL import Image, ImageColor, ImageDraw, ImageFont
 
 
 from misago.conf import settings
 from misago.conf import settings
 
 
 from . import store
 from . import store
 
 
-
 COLOR_WHEEL = (
 COLOR_WHEEL = (
     "#d32f2f",
     "#d32f2f",
     "#c2185b",
     "#c2185b",

+ 1 - 3
misago/users/avatars/gallery.py

@@ -1,15 +1,13 @@
 import random
 import random
 from pathlib import Path
 from pathlib import Path
 
 
-from PIL import Image
-
 from django.core.files.base import ContentFile
 from django.core.files.base import ContentFile
+from PIL import Image
 
 
 from misago.conf import settings
 from misago.conf import settings
 
 
 from . import store
 from . import store
 
 
-
 DEFAULT_GALLERY = "__default__"
 DEFAULT_GALLERY = "__default__"
 
 
 
 

+ 0 - 1
misago/users/avatars/gravatar.py

@@ -7,7 +7,6 @@ from misago.conf import settings
 
 
 from . import store
 from . import store
 
 
-
 GRAVATAR_URL = "http://www.gravatar.com/avatar/%s?s=%s&d=404"
 GRAVATAR_URL = "http://www.gravatar.com/avatar/%s?s=%s&d=404"
 
 
 
 

+ 1 - 2
misago/users/avatars/store.py

@@ -2,10 +2,9 @@ import os
 from hashlib import md5
 from hashlib import md5
 from io import BytesIO
 from io import BytesIO
 
 
-from PIL import Image
-
 from django.core.files.base import ContentFile
 from django.core.files.base import ContentFile
 from django.utils.crypto import get_random_string
 from django.utils.crypto import get_random_string
+from PIL import Image
 
 
 from misago.conf import settings
 from misago.conf import settings
 
 

+ 1 - 2
misago/users/avatars/uploaded.py

@@ -1,9 +1,8 @@
 from pathlib import Path
 from pathlib import Path
 
 
-from PIL import Image
-
 from django.core.exceptions import ValidationError
 from django.core.exceptions import ValidationError
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from PIL import Image
 
 
 from misago.conf import settings
 from misago.conf import settings
 
 

+ 0 - 1
misago/users/captcha.py

@@ -1,5 +1,4 @@
 import requests
 import requests
-
 from django.core.exceptions import ValidationError
 from django.core.exceptions import ValidationError
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
 
 

+ 0 - 1
misago/users/datadownloads/dataarchive.py

@@ -7,7 +7,6 @@ from django.utils.crypto import get_random_string
 
 
 from misago.core.utils import slugify
 from misago.core.utils import slugify
 
 
-
 FILENAME_MAX_LEN = 50
 FILENAME_MAX_LEN = 50
 
 
 
 

+ 1 - 2
misago/users/forms/admin.py

@@ -1,14 +1,13 @@
 from django import forms
 from django import forms
-from django.db.models import Q
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
 from django.contrib.auth.password_validation import validate_password
 from django.contrib.auth.password_validation import validate_password
+from django.db.models import Q
 from django.utils.translation import gettext_lazy as _
 from django.utils.translation import gettext_lazy as _
 from django.utils.translation import ngettext
 from django.utils.translation import ngettext
 
 
 from misago.acl.models import Role
 from misago.acl.models import Role
 from misago.admin.forms import IsoDateTimeField, YesNoSwitch
 from misago.admin.forms import IsoDateTimeField, YesNoSwitch
 from misago.core.validators import validate_sluggable
 from misago.core.validators import validate_sluggable
-
 from misago.users.models import Ban, DataDownload, Rank
 from misago.users.models import Ban, DataDownload, Rank
 from misago.users.profilefields import profilefields
 from misago.users.profilefields import profilefields
 from misago.users.utils import hash_email
 from misago.users.utils import hash_email

+ 0 - 1
misago/users/forms/auth.py

@@ -7,7 +7,6 @@ from django.utils.translation import gettext_lazy as _
 
 
 from misago.users.bans import get_user_ban
 from misago.users.bans import get_user_ban
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 0 - 1
misago/users/forms/register.py

@@ -11,7 +11,6 @@ from misago.users.validators import (
     validate_username,
     validate_username,
 )
 )
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 1 - 0
misago/users/management/commands/buildactivepostersranking.py

@@ -1,4 +1,5 @@
 from time import time
 from time import time
+
 from django.core.management.base import BaseCommand
 from django.core.management.base import BaseCommand
 
 
 from misago.users.activepostersranking import build_active_posters_ranking
 from misago.users.activepostersranking import build_active_posters_ranking

+ 0 - 1
misago/users/management/commands/createsuperuser.py

@@ -14,7 +14,6 @@ from django.utils.encoding import force_str
 
 
 from misago.cache.versions import get_cache_versions
 from misago.cache.versions import get_cache_versions
 from misago.conf.dynamicsettings import DynamicSettings
 from misago.conf.dynamicsettings import DynamicSettings
-
 from misago.users.setupnewuser import setup_new_user
 from misago.users.setupnewuser import setup_new_user
 from misago.users.validators import validate_email, validate_username
 from misago.users.validators import validate_email, validate_username
 
 

+ 0 - 1
misago/users/management/commands/deleteinactiveusers.py

@@ -7,7 +7,6 @@ from django.utils import timezone
 from misago.conf import settings
 from misago.conf import settings
 from misago.core.pgutils import chunk_queryset
 from misago.core.pgutils import chunk_queryset
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 1 - 3
misago/users/management/commands/deletemarkedusers.py

@@ -1,12 +1,10 @@
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
-from django.core.management.base import CommandError, BaseCommand
+from django.core.management.base import BaseCommand, CommandError
 
 
 from misago.conf import settings
 from misago.conf import settings
 from misago.core.pgutils import chunk_queryset
 from misago.core.pgutils import chunk_queryset
-
 from misago.users.permissions import can_delete_own_account
 from misago.users.permissions import can_delete_own_account
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 1 - 1
misago/users/management/commands/deleteprofilefield.py

@@ -1,5 +1,5 @@
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
-from django.core.management.base import CommandError, BaseCommand
+from django.core.management.base import BaseCommand, CommandError
 
 
 from misago.core.pgutils import chunk_queryset
 from misago.core.pgutils import chunk_queryset
 
 

+ 0 - 1
misago/users/management/commands/invalidatebans.py

@@ -2,7 +2,6 @@ from django.core.management.base import BaseCommand
 from django.utils import timezone
 from django.utils import timezone
 
 
 from misago.cache.versions import get_cache_versions
 from misago.cache.versions import get_cache_versions
-
 from misago.users import BANS_CACHE
 from misago.users import BANS_CACHE
 from misago.users.models import Ban, BanCache
 from misago.users.models import Ban, BanCache
 
 

+ 0 - 1
misago/users/management/commands/listusedprofilefields.py

@@ -3,7 +3,6 @@ from django.core.management.base import BaseCommand
 
 
 from misago.core.pgutils import chunk_queryset
 from misago.core.pgutils import chunk_queryset
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 0 - 1
misago/users/management/commands/populateonlinetracker.py

@@ -4,7 +4,6 @@ from django.core.management.base import BaseCommand
 from misago.core.pgutils import chunk_queryset
 from misago.core.pgutils import chunk_queryset
 from misago.users.models import Online
 from misago.users.models import Online
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 0 - 1
misago/users/management/commands/prepareuserdatadownloads.py

@@ -11,7 +11,6 @@ from misago.core.pgutils import chunk_queryset
 from misago.users.datadownloads import prepare_user_data_download
 from misago.users.datadownloads import prepare_user_data_download
 from misago.users.models import DataDownload
 from misago.users.models import DataDownload
 
 
-
 logger = logging.getLogger("misago.users.datadownloads")
 logger = logging.getLogger("misago.users.datadownloads")
 
 
 
 

+ 0 - 1
misago/users/management/commands/synchronizeusers.py

@@ -7,7 +7,6 @@ from misago.categories.models import Category
 from misago.core.management.progressbar import show_progress
 from misago.core.management.progressbar import show_progress
 from misago.core.pgutils import chunk_queryset
 from misago.core.pgutils import chunk_queryset
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 0 - 1
misago/users/migrations/0002_users_settings.py

@@ -2,7 +2,6 @@ from django.db import migrations
 
 
 from misago.conf.migrationutils import migrate_settings_group
 from misago.conf.migrationutils import migrate_settings_group
 
 
-
 _ = lambda s: s
 _ = lambda s: s
 
 
 
 

+ 0 - 1
misago/users/migrations/0004_default_ranks.py

@@ -3,7 +3,6 @@ from django.utils.translation import gettext
 
 
 from misago.core.utils import slugify
 from misago.core.utils import slugify
 
 
-
 _ = lambda s: s
 _ = lambda s: s
 
 
 
 

+ 1 - 0
misago/users/migrations/0009_redo_partial_indexes.py

@@ -1,5 +1,6 @@
 # Generated by Django 1.11.1 on 2017-05-26 21:56
 # Generated by Django 1.11.1 on 2017-05-26 21:56
 from django.db import migrations
 from django.db import migrations
+
 import misago.core.pgutils
 import misago.core.pgutils
 
 
 
 

+ 1 - 0
misago/users/migrations/0011_auto_20180331_2208.py

@@ -1,5 +1,6 @@
 # Generated by Django 1.11.11 on 2018-03-31 22:08
 # Generated by Django 1.11.11 on 2018-03-31 22:08
 from django.db import migrations, models
 from django.db import migrations, models
+
 import misago.core.pgutils
 import misago.core.pgutils
 
 
 
 

+ 2 - 2
misago/users/migrations/0012_audittrail.py

@@ -1,8 +1,8 @@
 # Generated by Django 1.11.13 on 2018-06-03 18:46
 # Generated by Django 1.11.13 on 2018-06-03 18:46
-from django.conf import settings
-from django.db import migrations, models
 import django.db.models.deletion
 import django.db.models.deletion
 import django.utils.timezone
 import django.utils.timezone
+from django.conf import settings
+from django.db import migrations, models
 
 
 
 
 class Migration(migrations.Migration):
 class Migration(migrations.Migration):

+ 3 - 2
misago/users/migrations/0014_datadownload.py

@@ -1,8 +1,9 @@
 # Generated by Django 1.11.13 on 2018-06-24 00:13
 # Generated by Django 1.11.13 on 2018-06-24 00:13
-from django.conf import settings
-from django.db import migrations, models
 import django.db.models.deletion
 import django.db.models.deletion
 import django.utils.timezone
 import django.utils.timezone
+from django.conf import settings
+from django.db import migrations, models
+
 import misago.users.models.datadownload
 import misago.users.models.datadownload
 
 
 
 

+ 2 - 1
misago/users/models/user.py

@@ -1,8 +1,9 @@
 from hashlib import md5
 from hashlib import md5
 
 
+from django.contrib.auth.models import AbstractBaseUser
 from django.contrib.auth.models import AnonymousUser as DjangoAnonymousUser
 from django.contrib.auth.models import AnonymousUser as DjangoAnonymousUser
+from django.contrib.auth.models import PermissionsMixin
 from django.contrib.auth.models import UserManager as BaseUserManager
 from django.contrib.auth.models import UserManager as BaseUserManager
-from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
 from django.contrib.auth.password_validation import validate_password
 from django.contrib.auth.password_validation import validate_password
 from django.contrib.postgres.fields import ArrayField, HStoreField, JSONField
 from django.contrib.postgres.fields import ArrayField, HStoreField, JSONField
 from django.core.mail import send_mail
 from django.core.mail import send_mail

+ 1 - 2
misago/users/online/tracker.py

@@ -1,6 +1,5 @@
-from rest_framework.request import Request
-
 from django.utils import timezone
 from django.utils import timezone
+from rest_framework.request import Request
 
 
 from misago.users.models import Online
 from misago.users.models import Online
 
 

+ 0 - 1
misago/users/online/utils.py

@@ -5,7 +5,6 @@ from django.utils import timezone
 from misago.users.bans import get_user_ban
 from misago.users.bans import get_user_ban
 from misago.users.models import BanCache, Online
 from misago.users.models import BanCache, Online
 
 
-
 ACTIVITY_CUTOFF = timedelta(minutes=2)
 ACTIVITY_CUTOFF = timedelta(minutes=2)
 
 
 
 

+ 0 - 1
misago/users/pages.py

@@ -1,6 +1,5 @@
 from misago.core.page import Page
 from misago.core.page import Page
 
 
-
 usercp = Page("usercp")
 usercp = Page("usercp")
 users_list = Page("users list")
 users_list = Page("users list")
 user_profile = Page("user profile")
 user_profile = Page("user profile")

+ 0 - 1
misago/users/permissions/decorators.py

@@ -1,7 +1,6 @@
 from django.core.exceptions import PermissionDenied
 from django.core.exceptions import PermissionDenied
 from django.utils.translation import gettext_lazy as _
 from django.utils.translation import gettext_lazy as _
 
 
-
 __all__ = ["authenticated_only", "anonymous_only"]
 __all__ = ["authenticated_only", "anonymous_only"]
 
 
 
 

+ 0 - 1
misago/users/permissions/delete.py

@@ -12,7 +12,6 @@ from misago.acl.decorators import return_boolean
 from misago.acl.models import Role
 from misago.acl.models import Role
 from misago.conf import settings
 from misago.conf import settings
 
 
-
 __all__ = [
 __all__ = [
     "allow_delete_user",
     "allow_delete_user",
     "can_delete_user",
     "can_delete_user",

+ 0 - 1
misago/users/permissions/moderation.py

@@ -13,7 +13,6 @@ from misago.acl.models import Role
 from misago.admin.forms import YesNoSwitch
 from misago.admin.forms import YesNoSwitch
 from misago.users.bans import get_user_ban
 from misago.users.bans import get_user_ban
 
 
-
 __all__ = [
 __all__ = [
     "allow_rename_user",
     "allow_rename_user",
     "can_rename_user",
     "can_rename_user",

+ 0 - 1
misago/users/permissions/profiles.py

@@ -10,7 +10,6 @@ from misago.admin.forms import YesNoSwitch
 
 
 from .decorators import authenticated_only
 from .decorators import authenticated_only
 
 
-
 __all__ = [
 __all__ = [
     "allow_browse_users_list",
     "allow_browse_users_list",
     "can_browse_users_list",
     "can_browse_users_list",

+ 0 - 1
misago/users/profilefields/basefields.py

@@ -4,7 +4,6 @@ from django.utils import html
 
 
 from misago.core.utils import format_plaintext_for_html
 from misago.core.utils import format_plaintext_for_html
 
 
-
 __all__ = [
 __all__ = [
     "ProfileField",
     "ProfileField",
     "TextProfileField",
     "TextProfileField",

+ 2 - 1
misago/users/profilefields/default.py

@@ -1,7 +1,8 @@
 import re
 import re
 
 
 from django.forms import ValidationError
 from django.forms import ValidationError
-from django.utils.translation import gettext, gettext_lazy as _
+from django.utils.translation import gettext
+from django.utils.translation import gettext_lazy as _
 
 
 from . import basefields
 from . import basefields
 
 

+ 0 - 1
misago/users/search.py

@@ -7,7 +7,6 @@ from misago.search import SearchProvider
 
 
 from .serializers import UserCardSerializer
 from .serializers import UserCardSerializer
 
 
-
 HEAD_RESULTS = 8
 HEAD_RESULTS = 8
 TAIL_RESULTS = 8
 TAIL_RESULTS = 8
 
 

+ 1 - 2
misago/users/serializers/auth.py

@@ -1,7 +1,6 @@
-from rest_framework import serializers
-
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
 from django.urls import reverse
 from django.urls import reverse
+from rest_framework import serializers
 
 
 from misago.acl.useracl import serialize_user_acl
 from misago.acl.useracl import serialize_user_acl
 
 

+ 1 - 3
misago/users/serializers/ban.py

@@ -1,11 +1,9 @@
-from rest_framework import serializers
-
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework import serializers
 
 
 from misago.core.utils import format_plaintext_for_html
 from misago.core.utils import format_plaintext_for_html
 from misago.users.models import Ban
 from misago.users.models import Ban
 
 
-
 __all__ = ["BanMessageSerializer", "BanDetailsSerializer"]
 __all__ = ["BanMessageSerializer", "BanDetailsSerializer"]
 
 
 
 

+ 0 - 1
misago/users/serializers/datadownload.py

@@ -2,7 +2,6 @@ from rest_framework import serializers
 
 
 from misago.users.models import DataDownload
 from misago.users.models import DataDownload
 
 
-
 __all__ = ["DataDownloadSerializer"]
 __all__ = ["DataDownloadSerializer"]
 
 
 
 

+ 1 - 3
misago/users/serializers/moderation.py

@@ -1,11 +1,9 @@
-from rest_framework import serializers
-
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
 from django.utils.translation import ngettext
 from django.utils.translation import ngettext
+from rest_framework import serializers
 
 
 from misago.conf import settings
 from misago.conf import settings
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 __all__ = ["ModerateAvatarSerializer", "ModerateSignatureSerializer"]
 __all__ = ["ModerateAvatarSerializer", "ModerateSignatureSerializer"]

+ 1 - 3
misago/users/serializers/options.py

@@ -1,14 +1,12 @@
-from rest_framework import serializers
-
 from django.contrib.auth import get_user_model, logout
 from django.contrib.auth import get_user_model, logout
 from django.contrib.auth.password_validation import validate_password
 from django.contrib.auth.password_validation import validate_password
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
+from rest_framework import serializers
 
 
 from misago.users.online.tracker import clear_tracking
 from misago.users.online.tracker import clear_tracking
 from misago.users.permissions import allow_delete_own_account
 from misago.users.permissions import allow_delete_own_account
 from misago.users.validators import validate_email, validate_username
 from misago.users.validators import validate_email, validate_username
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 __all__ = [
 __all__ = [

+ 0 - 1
misago/users/serializers/rank.py

@@ -3,7 +3,6 @@ from rest_framework import serializers
 from misago.core.utils import format_plaintext_for_html
 from misago.core.utils import format_plaintext_for_html
 from misago.users.models import Rank
 from misago.users.models import Rank
 
 
-
 __all__ = ["RankSerializer"]
 __all__ = ["RankSerializer"]
 
 
 
 

+ 1 - 3
misago/users/serializers/user.py

@@ -1,13 +1,11 @@
-from rest_framework import serializers
-
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
 from django.urls import reverse
 from django.urls import reverse
+from rest_framework import serializers
 
 
 from misago.core.serializers import MutableFields
 from misago.core.serializers import MutableFields
 
 
 from . import RankSerializer
 from . import RankSerializer
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 __all__ = ["StatusSerializer", "UserSerializer", "UserCardSerializer"]
 __all__ = ["StatusSerializer", "UserSerializer", "UserCardSerializer"]

+ 0 - 1
misago/users/serializers/usernamechange.py

@@ -4,7 +4,6 @@ from misago.users.models import UsernameChange
 
 
 from .user import UserSerializer as BaseUserSerializer
 from .user import UserSerializer as BaseUserSerializer
 
 
-
 __all__ = ["UsernameChangeSerializer"]
 __all__ = ["UsernameChangeSerializer"]
 
 
 UserSerializer = BaseUserSerializer.subset_fields("id", "username", "avatars", "url")
 UserSerializer = BaseUserSerializer.subset_fields("id", "username", "avatars", "url")

+ 1 - 1
misago/users/setupnewuser.py

@@ -1,5 +1,5 @@
-from .avatars import set_default_avatar
 from .audittrail import create_user_audit_trail
 from .audittrail import create_user_audit_trail
+from .avatars import set_default_avatar
 from .models import User
 from .models import User
 
 
 
 

+ 0 - 1
misago/users/signals.py

@@ -13,7 +13,6 @@ from misago.core.pgutils import chunk_queryset
 from .models import AuditTrail
 from .models import AuditTrail
 from .profilefields import profilefields
 from .profilefields import profilefields
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 anonymize_user_data = Signal()
 anonymize_user_data = Signal()

+ 2 - 4
misago/users/social/pipeline.py

@@ -8,9 +8,8 @@ from django.urls import reverse
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
 from social_core.pipeline.partial import partial
 from social_core.pipeline.partial import partial
 
 
-from misago.core.exceptions import SocialAuthFailed, SocialAuthBanned
+from misago.core.exceptions import SocialAuthBanned, SocialAuthFailed
 from misago.legal.models import Agreement
 from misago.legal.models import Agreement
-
 from misago.users.bans import get_request_ip_ban, get_user_ban
 from misago.users.bans import get_request_ip_ban, get_user_ban
 from misago.users.forms.register import SocialAuthRegisterForm
 from misago.users.forms.register import SocialAuthRegisterForm
 from misago.users.models import Ban
 from misago.users.models import Ban
@@ -22,14 +21,13 @@ from misago.users.registration import (
 from misago.users.setupnewuser import setup_new_user
 from misago.users.setupnewuser import setup_new_user
 from misago.users.validators import (
 from misago.users.validators import (
     ValidationError,
     ValidationError,
-    validate_new_registration,
     validate_email,
     validate_email,
+    validate_new_registration,
     validate_username,
     validate_username,
 )
 )
 
 
 from .utils import get_social_auth_backend_name, perpare_username
 from .utils import get_social_auth_backend_name, perpare_username
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 0 - 1
misago/users/templatetags/misago_avatars.py

@@ -1,6 +1,5 @@
 from django import template
 from django import template
 
 
-
 register = template.Library()
 register = template.Library()
 
 
 
 

+ 1 - 2
misago/users/tests/test_avatars.py

@@ -1,11 +1,10 @@
 from pathlib import Path
 from pathlib import Path
 from unittest.mock import Mock
 from unittest.mock import Mock
 
 
-from PIL import Image
-
 from django.core.exceptions import ValidationError
 from django.core.exceptions import ValidationError
 from django.test import TestCase
 from django.test import TestCase
 from django.utils.crypto import get_random_string
 from django.utils.crypto import get_random_string
+from PIL import Image
 
 
 from misago.conf import settings
 from misago.conf import settings
 from misago.users.avatars import (
 from misago.users.avatars import (

+ 1 - 1
misago/users/tests/test_bans.py

@@ -4,6 +4,7 @@ from django.test import TestCase
 from django.utils import timezone
 from django.utils import timezone
 
 
 from misago.conftest import get_cache_versions
 from misago.conftest import get_cache_versions
+from misago.users import BANS_CACHE
 from misago.users.bans import (
 from misago.users.bans import (
     ban_ip,
     ban_ip,
     ban_user,
     ban_user,
@@ -13,7 +14,6 @@ from misago.users.bans import (
     get_user_ban,
     get_user_ban,
     get_username_ban,
     get_username_ban,
 )
 )
-from misago.users import BANS_CACHE
 from misago.users.models import Ban
 from misago.users.models import Ban
 from misago.users.test import create_test_user
 from misago.users.test import create_test_user
 
 

+ 0 - 1
misago/users/tests/test_bio_profilefield.py

@@ -3,7 +3,6 @@ from django.urls import reverse
 
 
 from misago.admin.test import AdminTestCase
 from misago.admin.test import AdminTestCase
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 1 - 2
misago/users/tests/test_datadownloads.py

@@ -4,7 +4,7 @@ from django.core.files import File
 
 
 from misago.categories.models import Category
 from misago.categories.models import Category
 from misago.threads.models import Attachment, AttachmentType
 from misago.threads.models import Attachment, AttachmentType
-from misago.threads.test import post_thread, post_poll
+from misago.threads.test import post_poll, post_thread
 from misago.users.audittrail import create_user_audit_trail
 from misago.users.audittrail import create_user_audit_trail
 from misago.users.datadownloads import (
 from misago.users.datadownloads import (
     expire_user_data_download,
     expire_user_data_download,
@@ -15,7 +15,6 @@ from misago.users.datadownloads import (
 from misago.users.models import DataDownload
 from misago.users.models import DataDownload
 from misago.users.test import AuthenticatedUserTestCase
 from misago.users.test import AuthenticatedUserTestCase
 
 
-
 TESTFILES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "testfiles")
 TESTFILES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "testfiles")
 TEST_FILE_PATH = os.path.join(TESTFILES_DIR, "avatar.png")
 TEST_FILE_PATH = os.path.join(TESTFILES_DIR, "avatar.png")
 
 

+ 0 - 1
misago/users/tests/test_datadownloads_dataarchive.py

@@ -13,7 +13,6 @@ from misago.users.datadownloads.dataarchive import (
 )
 )
 from misago.users.test import AuthenticatedUserTestCase
 from misago.users.test import AuthenticatedUserTestCase
 
 
-
 DATA_DOWNLOADS_WORKING_DIR = settings.MISAGO_USER_DATA_DOWNLOADS_WORKING_DIR
 DATA_DOWNLOADS_WORKING_DIR = settings.MISAGO_USER_DATA_DOWNLOADS_WORKING_DIR
 TESTFILES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "testfiles")
 TESTFILES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "testfiles")
 TEST_AVATAR_PATH = os.path.join(TESTFILES_DIR, "avatar.png")
 TEST_AVATAR_PATH = os.path.join(TESTFILES_DIR, "avatar.png")

+ 0 - 1
misago/users/tests/test_expireuserdatadownloads.py

@@ -10,7 +10,6 @@ from misago.users.management.commands import expireuserdatadownloads
 from misago.users.models import DataDownload
 from misago.users.models import DataDownload
 from misago.users.test import AuthenticatedUserTestCase
 from misago.users.test import AuthenticatedUserTestCase
 
 
-
 TESTFILES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "testfiles")
 TESTFILES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "testfiles")
 TEST_FILE_PATH = os.path.join(TESTFILES_DIR, "avatar.png")
 TEST_FILE_PATH = os.path.join(TESTFILES_DIR, "avatar.png")
 
 

+ 0 - 1
misago/users/tests/test_gender_profilefield.py

@@ -3,7 +3,6 @@ from django.urls import reverse
 
 
 from misago.admin.test import AdminTestCase
 from misago.admin.test import AdminTestCase
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 0 - 1
misago/users/tests/test_invalidatebans.py

@@ -6,7 +6,6 @@ from django.test import TestCase
 from django.utils import timezone
 from django.utils import timezone
 
 
 from misago.cache.versions import get_cache_versions
 from misago.cache.versions import get_cache_versions
-
 from misago.users import bans
 from misago.users import bans
 from misago.users.management.commands import invalidatebans
 from misago.users.management.commands import invalidatebans
 from misago.users.models import Ban, BanCache
 from misago.users.models import Ban, BanCache

+ 0 - 1
misago/users/tests/test_joinip_profilefield.py

@@ -4,7 +4,6 @@ from django.urls import reverse
 from misago.acl.test import patch_user_acl
 from misago.acl.test import patch_user_acl
 from misago.admin.test import AdminTestCase
 from misago.admin.test import AdminTestCase
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 1 - 1
misago/users/tests/test_namechanges.py

@@ -1,8 +1,8 @@
 from datetime import timedelta
 from datetime import timedelta
 
 
 from misago.users.namechanges import (
 from misago.users.namechanges import (
-    get_next_available_namechange,
     get_left_namechanges,
     get_left_namechanges,
+    get_next_available_namechange,
     get_username_options,
     get_username_options,
 )
 )
 
 

+ 0 - 1
misago/users/tests/test_profilefields.py

@@ -3,7 +3,6 @@ from django.test import TestCase
 
 
 from misago.users.profilefields import ProfileFields
 from misago.users.profilefields import ProfileFields
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 0 - 1
misago/users/tests/test_remove_old_ips_command.py

@@ -8,7 +8,6 @@ from django.utils import timezone
 
 
 from misago.users.management.commands import removeoldips
 from misago.users.management.commands import removeoldips
 
 
-
 IP_STORE_TIME = 2
 IP_STORE_TIME = 2
 
 
 
 

+ 1 - 3
misago/users/tests/test_social_pipeline.py

@@ -9,11 +9,10 @@ from social_django.utils import load_strategy
 from misago.acl import ACL_CACHE
 from misago.acl import ACL_CACHE
 from misago.acl.useracl import get_user_acl
 from misago.acl.useracl import get_user_acl
 from misago.conf.dynamicsettings import DynamicSettings
 from misago.conf.dynamicsettings import DynamicSettings
-from misago.core.exceptions import SocialAuthFailed, SocialAuthBanned
 from misago.conf.test import override_dynamic_settings
 from misago.conf.test import override_dynamic_settings
 from misago.conftest import get_cache_versions
 from misago.conftest import get_cache_versions
+from misago.core.exceptions import SocialAuthBanned, SocialAuthFailed
 from misago.legal.models import Agreement
 from misago.legal.models import Agreement
-
 from misago.users.models import AnonymousUser, Ban, BanCache
 from misago.users.models import AnonymousUser, Ban, BanCache
 from misago.users.social.pipeline import (
 from misago.users.social.pipeline import (
     associate_by_email,
     associate_by_email,
@@ -26,7 +25,6 @@ from misago.users.social.pipeline import (
 )
 )
 from misago.users.test import UserTestCase
 from misago.users.test import UserTestCase
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 0 - 1
misago/users/tests/test_twitter_profilefield.py

@@ -3,7 +3,6 @@ from django.urls import reverse
 
 
 from misago.admin.test import AdminTestCase
 from misago.admin.test import AdminTestCase
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 0 - 1
misago/users/tests/test_user_model.py

@@ -4,7 +4,6 @@ from django.test import TestCase
 
 
 from misago.conf import settings
 from misago.conf import settings
 from misago.core.utils import slugify
 from misago.core.utils import slugify
-
 from misago.users.avatars import dynamic
 from misago.users.avatars import dynamic
 from misago.users.models import Avatar, User
 from misago.users.models import Avatar, User
 
 

+ 0 - 1
misago/users/tests/test_useradmin_views.py

@@ -8,7 +8,6 @@ from misago.categories.models import Category
 from misago.legal.models import Agreement
 from misago.legal.models import Agreement
 from misago.legal.utils import save_user_agreement_acceptance
 from misago.legal.utils import save_user_agreement_acceptance
 from misago.threads.test import post_thread, reply_thread
 from misago.threads.test import post_thread, reply_thread
-
 from misago.users.datadownloads import request_user_data_download
 from misago.users.datadownloads import request_user_data_download
 from misago.users.models import Ban, DataDownload, Rank
 from misago.users.models import Ban, DataDownload, Rank
 from misago.users.test import create_test_user
 from misago.users.test import create_test_user

+ 0 - 1
misago/users/urls/api.py

@@ -6,7 +6,6 @@ from misago.users.api.ranks import RanksViewSet
 from misago.users.api.usernamechanges import UsernameChangesViewSet
 from misago.users.api.usernamechanges import UsernameChangesViewSet
 from misago.users.api.users import UserViewSet
 from misago.users.api.users import UserViewSet
 
 
-
 urlpatterns = [
 urlpatterns = [
     url(r"^auth/$", auth.gateway, name="auth"),
     url(r"^auth/$", auth.gateway, name="auth"),
     url(r"^auth/criteria/$", auth.get_criteria, name="auth-criteria"),
     url(r"^auth/criteria/$", auth.get_criteria, name="auth-criteria"),

+ 0 - 2
misago/users/validators.py

@@ -2,7 +2,6 @@ import json
 import re
 import re
 
 
 import requests
 import requests
-
 from django.contrib.auth import get_user_model
 from django.contrib.auth import get_user_model
 from django.core.exceptions import ValidationError
 from django.core.exceptions import ValidationError
 from django.core.validators import validate_email as validate_email_content
 from django.core.validators import validate_email as validate_email_content
@@ -15,7 +14,6 @@ from misago.conf import settings
 
 
 from .bans import get_email_ban, get_username_ban
 from .bans import get_email_ban, get_username_ban
 
 
-
 USERNAME_RE = re.compile(r"^[0-9a-z]+$", re.IGNORECASE)
 USERNAME_RE = re.compile(r"^[0-9a-z]+$", re.IGNORECASE)
 
 
 User = get_user_model()
 User = get_user_model()

+ 0 - 1
misago/users/views/activation.py

@@ -8,7 +8,6 @@ from misago.users.bans import get_user_ban
 from misago.users.decorators import deny_authenticated, deny_banned_ips
 from misago.users.decorators import deny_authenticated, deny_banned_ips
 from misago.users.tokens import is_activation_token_valid
 from misago.users.tokens import is_activation_token_valid
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 0 - 1
misago/users/views/avatarserver.py

@@ -4,7 +4,6 @@ from django.shortcuts import redirect
 
 
 from misago.conf import settings
 from misago.conf import settings
 
 
-
 User = get_user_model()
 User = get_user_model()
 
 
 
 

+ 0 - 1
misago/users/views/profile.py

@@ -16,7 +16,6 @@ from misago.users.serializers import (
 )
 )
 from misago.users.viewmodels import Followers, Follows, UserPosts, UserThreads
 from misago.users.viewmodels import Followers, Follows, UserPosts, UserThreads
 
 
-
 User = get_user_model()
 User = get_user_model()