From effb56ef1d4646dd8fabcbad07ebceb444ec1d5e Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sat, 5 Aug 2023 13:35:53 +0200 Subject: [PATCH] Format using black --- photologue/management/commands/duplicate.py | 2 +- photologue/management/commands/plcache.py | 1 - photologue/migrations/0001_initial.py | 1 - photologue/migrations/0002_auto_20220130_1020.py | 1 - photologue/migrations/0003_remove_gallery_is_public.py | 1 - photologue/models.py | 2 +- photologue/views.py | 9 +++++++-- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/photologue/management/commands/duplicate.py b/photologue/management/commands/duplicate.py index 9f8637e..5ca0e5b 100644 --- a/photologue/management/commands/duplicate.py +++ b/photologue/management/commands/duplicate.py @@ -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() diff --git a/photologue/management/commands/plcache.py b/photologue/management/commands/plcache.py index 5d66fbb..4b26da6 100644 --- a/photologue/management/commands/plcache.py +++ b/photologue/management/commands/plcache.py @@ -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): diff --git a/photologue/migrations/0001_initial.py b/photologue/migrations/0001_initial.py index f483780..46547a2 100644 --- a/photologue/migrations/0001_initial.py +++ b/photologue/migrations/0001_initial.py @@ -12,7 +12,6 @@ import photologue.models class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/photologue/migrations/0002_auto_20220130_1020.py b/photologue/migrations/0002_auto_20220130_1020.py index ae9b359..9627418 100644 --- a/photologue/migrations/0002_auto_20220130_1020.py +++ b/photologue/migrations/0002_auto_20220130_1020.py @@ -6,7 +6,6 @@ from django.db import migrations class Migration(migrations.Migration): - dependencies = [ ("photologue", "0001_initial"), ] diff --git a/photologue/migrations/0003_remove_gallery_is_public.py b/photologue/migrations/0003_remove_gallery_is_public.py index d201913..8de8a3a 100644 --- a/photologue/migrations/0003_remove_gallery_is_public.py +++ b/photologue/migrations/0003_remove_gallery_is_public.py @@ -6,7 +6,6 @@ from django.db import migrations class Migration(migrations.Migration): - dependencies = [ ("photologue", "0002_auto_20220130_1020"), ] diff --git a/photologue/models.py b/photologue/models.py index 275d8fb..8b7dbcd 100644 --- a/photologue/models.py +++ b/photologue/models.py @@ -34,7 +34,7 @@ LATEST_LIMIT = getattr(settings, "PHOTOLOGUE_GALLERY_LATEST_LIMIT", None) IMAGE_FIELD_MAX_LENGTH = getattr(settings, "PHOTOLOGUE_IMAGE_FIELD_MAX_LENGTH", 100) # Modify image file buffer size. -ImageFile.MAXBLOCK = getattr(settings, "PHOTOLOGUE_MAXBLOCK", 256 * 2 ** 10) +ImageFile.MAXBLOCK = getattr(settings, "PHOTOLOGUE_MAXBLOCK", 256 * 2**10) # Look for user function to define file paths PHOTOLOGUE_PATH = getattr(settings, "PHOTOLOGUE_PATH", None) diff --git a/photologue/views.py b/photologue/views.py index 4914804..4ea27a2 100644 --- a/photologue/views.py +++ b/photologue/views.py @@ -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.")