Browse Source

Run black on code

rafalp 6 years ago
parent
commit
c1f4d601af

+ 3 - 1
misago/categories/views/permsadmin.py

@@ -51,7 +51,9 @@ class RoleFormMixin:
                     form.instance.permissions = new_permissions
                     form.instance.save()
 
-                    messages.success(request, self.message_submit % {"name": target.name})
+                    messages.success(
+                        request, self.message_submit % {"name": target.name}
+                    )
 
                     if "stay" in request.POST:
                         return redirect(request.path)

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

@@ -96,11 +96,11 @@ PLAINTEXT_FORMAT_CASES = [
     (
         "http://misago-project.org/login/",
         (
-            '<p>'
+            "<p>"
             '<a href="http://misago-project.org/login/">'
-            'http://misago-project.org/login/'
-            '</a>'
-            '</p>'
+            "http://misago-project.org/login/"
+            "</a>"
+            "</p>"
         ),
     ),
 ]

+ 1 - 1
misago/legal/utils.py

@@ -46,7 +46,7 @@ def get_parsed_agreement_text(request, agreement):
 
     if cached_content and cached_content.get("checksum") == unparsed_checksum:
         return cached_content["parsed"]
-    
+
     parsed = common_flavour(request, None, unparsed_content)["parsed_text"]
     cached_content = {"checksum": unparsed_checksum, "parsed": parsed}
     cache.set(cache_name, cached_content)

+ 1 - 1
misago/readtracker/dates.py

@@ -16,7 +16,7 @@ def get_cutoff_date(user=None):
 def is_date_tracked(date, user):
     if not date:
         return False
-    
+
     cutoff_date = get_cutoff_date()
     if cutoff_date < user.joined_on:
         cutoff_date = user.joined_on

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

@@ -201,7 +201,7 @@ class ViewSet(viewsets.ViewSet):
 
         if "reply" not in request.query_params:
             return Response({})
-        
+
         reply_to = self.get_post(
             request, thread, request.query_params["reply"]
         ).unwrap()

+ 2 - 10
misago/threads/api/threads.py

@@ -87,11 +87,7 @@ class ThreadViewSet(ViewSet):
         posting.save()
 
         return Response(
-            {
-                "id": thread.pk,
-                "title": thread.title,
-                "url": thread.get_absolute_url(),
-            }
+            {"id": thread.pk, "title": thread.title, "url": thread.get_absolute_url()}
         )
 
     @detail_route(methods=["post"], url_path="merge")
@@ -144,9 +140,5 @@ class PrivateThreadViewSet(ViewSet):
         posting.save()
 
         return Response(
-            {
-                "id": thread.pk,
-                "title": thread.title,
-                "url": thread.get_absolute_url(),
-            }
+            {"id": thread.pk, "title": thread.title, "url": thread.get_absolute_url()}
         )

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

@@ -1399,7 +1399,7 @@ def exclude_invisible_threads(user_acl, categories, queryset):
 
     if not conditions:
         return Thread.objects.none()
-    
+
     return queryset.filter(conditions)
 
 

+ 2 - 4
misago/threads/threadtypes/thread.py

@@ -18,7 +18,7 @@ class Thread(ThreadType):
             return reverse(
                 "misago:category", kwargs={"pk": category.pk, "slug": category.slug}
             )
-        
+
         return reverse("misago:threads")
 
     def get_category_last_thread_url(self, category):
@@ -46,9 +46,7 @@ class Thread(ThreadType):
                 kwargs={"slug": thread.slug, "pk": thread.pk, "page": page},
             )
 
-        return reverse(
-            "misago:thread", kwargs={"slug": thread.slug, "pk": thread.pk}
-        )
+        return reverse("misago:thread", kwargs={"slug": thread.slug, "pk": thread.pk})
 
     def get_thread_last_post_url(self, thread):
         return reverse(

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

@@ -7,7 +7,7 @@ from rest_framework.response import Response
 def question(request):
     if not request.settings.qa_question:
         raise Http404()
-    
+
     return Response(
         {
             "question": request.settings.qa_question,

+ 1 - 1
misago/users/api/userendpoints/avatar.py

@@ -220,7 +220,7 @@ def moderate_avatar_endpoint(request, profile):
                 "avatar_lock_staff_message": profile.avatar_lock_staff_message,
             }
         )
-    
+
     return Response(
         {
             "is_avatar_locked": int(profile.is_avatar_locked),

+ 1 - 0
misago/users/apps.py

@@ -78,6 +78,7 @@ class MisagoUsersConfig(AppConfig):
             if request.user.is_authenticated:
                 if request.user_acl["can_see_ban_details"]:
                     from .bans import get_user_ban
+
                     return bool(get_user_ban(profile, request.cache_versions))
                 return False
             return False