actually fix bug where you can't select /SAS as a parent album

This commit is contained in:
imperosol
2026-04-22 00:06:35 +02:00
parent da3602329c
commit d36d672d0b
6 changed files with 75 additions and 76 deletions
+4 -2
View File
@@ -886,8 +886,10 @@ class SithFile(models.Model):
return self.get_parent_path() + "/" + self.name
def save(self, *args, **kwargs):
sas = SithFile.objects.filter(id=settings.SITH_SAS_ROOT_DIR_ID).first()
self.is_in_sas = sas in self.get_parent_list() or self == sas
sas_id = settings.SITH_SAS_ROOT_DIR_ID
self.is_in_sas = self.id == sas_id or any(
p.id == sas_id for p in self.get_parent_list()
)
adding = self._state.adding
super().save(*args, **kwargs)
if adding: