add subscriptions to projects & issues

This commit is contained in:
Élie Bouttier 2014-08-16 22:44:42 -07:00
parent db7b93df2e
commit e881031945
6 changed files with 126 additions and 1 deletions

View file

@ -51,6 +51,9 @@ class Project(models.Model):
verbose_name="Do unregistered users have read access "
"to this project?")
subscribers = models.ManyToManyField(User, blank=True, null=True,
related_name='subscribed_projects')
def grant_user(self, user):
perm = ProjectPermission(project=self,
manage_project_permission=True,
@ -157,6 +160,9 @@ class Issue(models.Model):
assignee = models.ForeignKey(User, blank=True, null=True, related_name='+')
subscribers = models.ManyToManyField(User, blank=True, null=True,
related_name='subscribed_issues')
@staticmethod
def next_id(project):