Skip to content

Commit

Permalink
Fix black errors
Browse files Browse the repository at this point in the history
  • Loading branch information
KiOui committed Apr 9, 2024
1 parent 5d5ce0e commit 5c9810f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions website/borrel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
)
Expand Down
6 changes: 3 additions & 3 deletions website/thaliedje/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5c9810f

Please sign in to comment.