Format using black
This commit is contained in:
parent
da8b0fc323
commit
effb56ef1d
7 changed files with 9 additions and 8 deletions
|
|
@ -53,7 +53,7 @@ class Command(BaseCommand):
|
||||||
# Delete them if --delete
|
# Delete them if --delete
|
||||||
if options["delete"]:
|
if options["delete"]:
|
||||||
self.stdout.write(" Deleting duplicate in {} :".format(gallery.slug))
|
self.stdout.write(" Deleting duplicate in {} :".format(gallery.slug))
|
||||||
for (_original, copies) in duplicates:
|
for _original, copies in duplicates:
|
||||||
for copy in copies:
|
for copy in copies:
|
||||||
self.stdout.write(" Deleting {}...".format(copy.slug))
|
self.stdout.write(" Deleting {}...".format(copy.slug))
|
||||||
copy.delete()
|
copy.delete()
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ from photologue.models import ImageModel, PhotoSize
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
|
|
||||||
help = "Manages Photologue cache file for the given sizes."
|
help = "Manages Photologue cache file for the given sizes."
|
||||||
|
|
||||||
def add_arguments(self, parser):
|
def add_arguments(self, parser):
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ import photologue.models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("photologue", "0001_initial"),
|
("photologue", "0001_initial"),
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("photologue", "0002_auto_20220130_1020"),
|
("photologue", "0002_auto_20220130_1020"),
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -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)
|
IMAGE_FIELD_MAX_LENGTH = getattr(settings, "PHOTOLOGUE_IMAGE_FIELD_MAX_LENGTH", 100)
|
||||||
|
|
||||||
# Modify image file buffer size.
|
# 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
|
# Look for user function to define file paths
|
||||||
PHOTOLOGUE_PATH = getattr(settings, "PHOTOLOGUE_PATH", None)
|
PHOTOLOGUE_PATH = getattr(settings, "PHOTOLOGUE_PATH", None)
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,9 @@ class GalleryDateView(LoginRequiredMixin):
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
"""Always show all years in archive"""
|
"""Always show all years in archive"""
|
||||||
context = super().get_context_data(**kwargs)
|
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
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -232,7 +234,10 @@ class GalleryUpload(PermissionRequiredMixin, FormView):
|
||||||
# Notify user then managers
|
# Notify user then managers
|
||||||
n_success = len(uploaded_photo_name)
|
n_success = len(uploaded_photo_name)
|
||||||
if already_exists:
|
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:
|
else:
|
||||||
messages.success(self.request, f"{n_success} photo(s) uploaded.")
|
messages.success(self.request, f"{n_success} photo(s) uploaded.")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue