mirror of
https://github.com/ae-utbm/sith.git
synced 2025-09-18 06:03:49 +00:00
Better usage of cache for group retrieval
This commit is contained in:
committed by
maréchal
parent
96dede5077
commit
aa7ec7f1f7
@@ -340,9 +340,10 @@ class Poster(models.Model):
|
||||
raise ValidationError(_("Begin date should be before end date"))
|
||||
|
||||
def is_owned_by(self, user):
|
||||
return user.is_in_group(
|
||||
settings.SITH_GROUP_COM_ADMIN_ID
|
||||
) or Club.objects.filter(id__in=user.clubs_with_rights)
|
||||
return (
|
||||
user.is_in_group(settings.SITH_GROUP_COM_ADMIN_ID)
|
||||
or len(user.clubs_with_rights) > 0
|
||||
)
|
||||
|
||||
def can_be_moderated_by(self, user):
|
||||
return user.is_in_group(settings.SITH_GROUP_COM_ADMIN_ID)
|
||||
|
Reference in New Issue
Block a user