Intitial teams support #147
@ -385,10 +385,14 @@ class Extension(CreatedModifiedMixin, RatingMixin, TrackChangesMixin, models.Mod
|
||||
)
|
||||
|
||||
def has_maintainer(self, user) -> bool:
|
||||
"""Return True if given user is listed as a maintainer."""
|
||||
"""Return True if given user is listed as a maintainer or is a member of the team."""
|
||||
if user is None or user.is_anonymous:
|
||||
return False
|
||||
return user in self.authors.all()
|
||||
if user in self.authors.all():
|
||||
return True
|
||||
if self.team and user in self.team.users.all():
|
||||
return True
|
||||
return False
|
||||
|
||||
def can_rate(self, user) -> bool:
|
||||
"""Return True if given user can rate this extension.
|
||||
|
Loading…
Reference in New Issue
Block a user