Intitial teams support #147

Merged
Oleg-Komarov merged 34 commits from teams-support into main 2024-05-23 19:43:54 +02:00
Showing only changes of commit 55394ca835 - Show all commits

View File

@ -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.