Make all galleries public

This commit is contained in:
Alexandre Iooss 2022-01-30 13:13:53 +01:00
parent 8b768108d2
commit 4b3cf83181
7 changed files with 24 additions and 31 deletions

View file

@ -15,7 +15,6 @@ import exifread
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
from django.core.validators import RegexValidator
from django.db import models
from django.template.defaultfilters import slugify
@ -153,10 +152,6 @@ class Gallery(models.Model):
verbose_name=_('tags'),
blank=True,
)
is_public = models.BooleanField(_('is public'),
default=True,
help_text=_('Public galleries will be displayed '
'in the default views.'))
photos = models.ManyToManyField('photologue.Photo',
related_name='galleries',
verbose_name=_('photos'),
@ -500,7 +495,7 @@ class Photo(ImageModel):
def public_galleries(self):
"""Return the public galleries to which this photo belongs."""
return self.galleries.filter(is_public=True)
return self.galleries
def get_previous_in_gallery(self, gallery):
"""Find the neighbour of this photo in the supplied gallery.