From d00a383d5429b00809232a84acea804c6c0153fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lie=20Bouttier?= Date: Sat, 8 Oct 2016 20:31:28 +0200 Subject: [PATCH] add talk moderation role to track managers --- proposals/models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/proposals/models.py b/proposals/models.py index 97d9506..491bc5e 100644 --- a/proposals/models.py +++ b/proposals/models.py @@ -133,7 +133,13 @@ class Talk(PonyConfModel): participation = Participation.objects.get(site=self.site, user=user) except Participation.DoesNotExists: return False - return participation.orga or self.topics.filter(reviewers=participation.user).exists() + if participation.orga: + return True + if self.topics.filter(reviewers=participation.user).exists(): + return True + if self.track and self.track.managers.filter(user=participation.user).exists(): + return True + return False def is_editable_by(self, user): return user == self.proposer or user in self.speakers.all() or self.is_moderable_by(user)