mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
Add is_in_sas field, to perform queries on it
This commit is contained in:
@ -14,11 +14,6 @@ class Picture(SithFile):
|
||||
class Meta:
|
||||
proxy = True
|
||||
|
||||
@property
|
||||
def is_in_sas(self):
|
||||
sas = SithFile.objects.filter(id=settings.SITH_SAS_ROOT_DIR_ID).first()
|
||||
return sas in self.get_parent_list()
|
||||
|
||||
@property
|
||||
def is_vertical(self):
|
||||
im = Image.open(BytesIO(self.file.read()))
|
||||
@ -79,11 +74,6 @@ class Album(SithFile):
|
||||
class Meta:
|
||||
proxy = True
|
||||
|
||||
@property
|
||||
def is_in_sas(self):
|
||||
sas = SithFile.objects.filter(id=settings.SITH_SAS_ROOT_DIR_ID).first()
|
||||
return sas in self.get_parent_list()
|
||||
|
||||
def can_be_edited_by(self, user):
|
||||
return user.is_in_group(settings.SITH_SAS_ADMIN_GROUP_ID)
|
||||
|
||||
|
Reference in New Issue
Block a user