Format using black

This commit is contained in:
Alexandre Iooss 2023-08-05 13:35:53 +02:00
parent da8b0fc323
commit effb56ef1d
7 changed files with 9 additions and 8 deletions

View file

@ -53,7 +53,7 @@ class Command(BaseCommand):
# Delete them if --delete
if options["delete"]:
self.stdout.write(" Deleting duplicate in {} :".format(gallery.slug))
for (_original, copies) in duplicates:
for _original, copies in duplicates:
for copy in copies:
self.stdout.write(" Deleting {}...".format(copy.slug))
copy.delete()

View file

@ -6,7 +6,6 @@ from photologue.models import ImageModel, PhotoSize
class Command(BaseCommand):
help = "Manages Photologue cache file for the given sizes."
def add_arguments(self, parser):

View file

@ -12,7 +12,6 @@ import photologue.models
class Migration(migrations.Migration):
initial = True
dependencies = [

View file

@ -6,7 +6,6 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("photologue", "0001_initial"),
]

View file

@ -6,7 +6,6 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("photologue", "0002_auto_20220130_1020"),
]

View file

@ -40,7 +40,9 @@ class GalleryDateView(LoginRequiredMixin):
def get_context_data(self, **kwargs):
"""Always show all years in archive"""
context = super().get_context_data(**kwargs)
context['date_list'] = self.get_queryset().dates(self.date_field, 'year', 'DESC')
context["date_list"] = self.get_queryset().dates(
self.date_field, "year", "DESC"
)
return context
@ -232,7 +234,10 @@ class GalleryUpload(PermissionRequiredMixin, FormView):
# Notify user then managers
n_success = len(uploaded_photo_name)
if already_exists:
messages.success(self.request, f"{n_success} photo(s) uploaded, {already_exists} photo(s) skipped as they already exist in this gallery.")
messages.success(
self.request,
f"{n_success} photo(s) uploaded, {already_exists} photo(s) skipped as they already exist in this gallery.",
)
else:
messages.success(self.request, f"{n_success} photo(s) uploaded.")