mirror of
https://github.com/ae-utbm/sith.git
synced 2026-04-22 03:03:13 +00:00
actually fix bug where you can't select /SAS as a parent album
This commit is contained in:
+4
-2
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user