浏览代码

make black (#4235)

master
Christian Clauss 1年前
父节点
当前提交
8f57e5cfae
没有帐户链接到提交者的电子邮件

+ 3
- 3
src/oscar/apps/basket/views.py 查看文件

@@ -350,9 +350,9 @@ class BasketAddView(FormView):
350 350
         # if the SESSION_SERIALIZER has been configured to 'django.contrib.sessions.serializers.PickleSerializer'.
351 351
         # see: https://docs.djangoproject.com/en/3.2/topics/http/sessions/#cookie-session-backend
352 352
         serialized_data = JSONSerializer().dumps(self.request.POST)
353
-        self.request.session[
354
-            "add_to_basket_form_post_data_%s" % self.product.pk
355
-        ] = serialized_data.decode("latin-1")
353
+        self.request.session["add_to_basket_form_post_data_%s" % self.product.pk] = (
354
+            serialized_data.decode("latin-1")
355
+        )
356 356
 
357 357
         return redirect_to_referrer(self.request, "basket:summary")
358 358
 

+ 0
- 1
src/oscar/apps/catalogue/abstract_models.py 查看文件

@@ -1498,7 +1498,6 @@ class AbstractOption(models.Model):
1498 1498
 
1499 1499
 
1500 1500
 class MissingProductImage(object):
1501
-
1502 1501
     """
1503 1502
     Mimics a Django file field by having a name property.
1504 1503
 

+ 0
- 1
src/oscar/apps/dashboard/catalogue/views.py 查看文件

@@ -77,7 +77,6 @@ Option = get_model("catalogue", "Option")
77 77
 
78 78
 
79 79
 class ProductListView(PartnerProductFilterMixin, SingleTableView):
80
-
81 80
     """
82 81
     Dashboard view of the product list.
83 82
     Supports the permission-based dashboard.

+ 3
- 3
src/oscar/apps/dashboard/orders/views.py 查看文件

@@ -388,9 +388,9 @@ class OrderListView(EventHandlerMixin, BulkEditMixin, ListView):
388 388
 
389 389
     def download_selected_orders(self, request, orders):
390 390
         response = HttpResponse(content_type="text/csv")
391
-        response[
392
-            "Content-Disposition"
393
-        ] = "attachment; filename=%s" % self.get_download_filename(request)
391
+        response["Content-Disposition"] = (
392
+            "attachment; filename=%s" % self.get_download_filename(request)
393
+        )
394 394
         writer = UnicodeCSVWriter(open_file=response)
395 395
 
396 396
         writer.writerow(self.CSV_COLUMNS.values())

+ 9
- 9
tests/integration/core/test_loading.py 查看文件

@@ -60,9 +60,9 @@ class TestClassLoading(TestCase):
60 60
         replaced_app_idx = installed_apps.index(
61 61
             "tests._site.apps.catalogue.apps.CatalogueConfig"
62 62
         )
63
-        installed_apps[
64
-            replaced_app_idx
65
-        ] = "tests._site.import_error_app.catalogue.apps.CatalogueConfig"
63
+        installed_apps[replaced_app_idx] = (
64
+            "tests._site.import_error_app.catalogue.apps.CatalogueConfig"
65
+        )
66 66
         with override_settings(INSTALLED_APPS=installed_apps):
67 67
             with self.assertRaises(ImportError):
68 68
                 get_class("catalogue.import_error_module", "ImportErrorClass")
@@ -74,9 +74,9 @@ class ClassLoadingWithLocalOverrideTests(TestCase):
74 74
         replaced_app_idx = self.installed_apps.index(
75 75
             "oscar.apps.shipping.apps.ShippingConfig"
76 76
         )
77
-        self.installed_apps[
78
-            replaced_app_idx
79
-        ] = "tests._site.apps.shipping.apps.ShippingConfig"
77
+        self.installed_apps[replaced_app_idx] = (
78
+            "tests._site.apps.shipping.apps.ShippingConfig"
79
+        )
80 80
 
81 81
     def test_loading_class_defined_in_local_module(self):
82 82
         with override_settings(INSTALLED_APPS=self.installed_apps):
@@ -133,9 +133,9 @@ class ClassLoadingWithLocalOverrideWithMultipleSegmentsTests(TestCase):
133 133
         replaced_app_idx = self.installed_apps.index(
134 134
             "oscar.apps.shipping.apps.ShippingConfig"
135 135
         )
136
-        self.installed_apps[
137
-            replaced_app_idx
138
-        ] = "tests._site.apps.shipping.apps.ShippingConfig"
136
+        self.installed_apps[replaced_app_idx] = (
137
+            "tests._site.apps.shipping.apps.ShippingConfig"
138
+        )
139 139
 
140 140
     def test_loading_class_defined_in_local_module(self):
141 141
         with override_settings(INSTALLED_APPS=self.installed_apps):

正在加载...
取消
保存