mirror of
https://github.com/ae-utbm/sith.git
synced 2026-04-08 19:55:31 +00:00
Fix bug where you can't select /SAS as a parent album
This commit is contained in:
@@ -37,7 +37,7 @@ from sas.forms import (
|
||||
PictureModerationRequestForm,
|
||||
PictureUploadForm,
|
||||
)
|
||||
from sas.models import Album, PeoplePictureRelation, Picture
|
||||
from sas.models import Album, AlbumQuerySet, PeoplePictureRelation, Picture
|
||||
|
||||
|
||||
class AlbumCreateFragment(FragmentMixin, CreateView):
|
||||
@@ -266,6 +266,9 @@ class AlbumEditView(CanEditMixin, UpdateView):
|
||||
template_name = "core/edit.jinja"
|
||||
pk_url_kwarg = "album_id"
|
||||
|
||||
def get_queryset(self) -> AlbumQuerySet:
|
||||
return super().get_queryset().exclude(id=settings.SITH_SAS_ROOT_DIR_ID)
|
||||
|
||||
def form_valid(self, form):
|
||||
ret = super().form_valid(form)
|
||||
if form.cleaned_data["recursive"]:
|
||||
|
||||
Reference in New Issue
Block a user