forked from AFPy/PonyConf
fix track permissions
This commit is contained in:
parent
d4899a1d14
commit
f3b4195ecf
|
@ -92,12 +92,16 @@ class Participation(PonyConfModel):
|
|||
return self.orga
|
||||
|
||||
def is_staff(self):
|
||||
return self.is_orga() or self.topic_set.exists()
|
||||
return self.is_orga() or self.topic_set.exists() or self.track_set.exists()
|
||||
|
||||
@property
|
||||
def topic_set(self):
|
||||
return self.user.topic_set.filter(site=self.site)
|
||||
|
||||
@property
|
||||
def track_set(self):
|
||||
return self.user.track_set.filter(site=self.site)
|
||||
|
||||
@property
|
||||
def talk_set(self):
|
||||
return self.user.talk_set.filter(site=self.site)
|
||||
|
|
|
@ -135,9 +135,9 @@ class Talk(PonyConfModel):
|
|||
return False
|
||||
if participation.orga:
|
||||
return True
|
||||
if self.topics.filter(reviewers=participation.user).exists():
|
||||
if self.topics.filter(reviewers=user).exists():
|
||||
return True
|
||||
if self.track and self.track.managers.filter(user=participation.user).exists():
|
||||
if self.track and user in self.track.managers.all():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user