From 5c9810fd63f092f53b19792fa7de853fd52d6fe7 Mon Sep 17 00:00:00 2001 From: Lars van Rhijn Date: Tue, 9 Apr 2024 20:36:43 +0200 Subject: [PATCH] Fix black errors --- website/borrel/views.py | 8 +++++--- website/thaliedje/forms.py | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/website/borrel/views.py b/website/borrel/views.py index 585f688a..62869512 100644 --- a/website/borrel/views.py +++ b/website/borrel/views.py @@ -118,9 +118,11 @@ def _sort_formset(self, formset): # Do the actual sorting formset.forms.sort( key=lambda x: ( - x.initial["product"].category.id - if x.initial["product"].category - else (ProductCategory.objects.latest("pk").pk + 1 if ProductCategory.objects.count() > 0 else 1), + ( + x.initial["product"].category.id + if x.initial["product"].category + else (ProductCategory.objects.latest("pk").pk + 1 if ProductCategory.objects.count() > 0 else 1) + ), x.initial["product"].name, ) ) diff --git a/website/thaliedje/forms.py b/website/thaliedje/forms.py index 7dae6b3d..78c78850 100644 --- a/website/thaliedje/forms.py +++ b/website/thaliedje/forms.py @@ -35,9 +35,9 @@ def __init__(self, *args, **kwargs): "{} (currently offline)".format(instance.playback_device_name), ) ) - self.fields[ - "playback_device_id" - ].help_text = "The currently selected device appears to be offline." + self.fields["playback_device_id"].help_text = ( + "The currently selected device appears to be offline." + ) if len(choices) == 0 and instance.playback_device_id == "": self.fields["playback_device_id"].help_text = "No online Spotify clients were found." choices = [("", "----------")] + choices