'Add a project to this release.
Returns True if the project was added and did not already exist.'

def add_project(self, project):

    from sentry.models import Project
    try:
        with transaction.atomic():
            ReleaseProject.objects.create(project=project, release=self)
            if (not project.flags.has_releases):
                project.flags.has_releases = True
                project.update(flags=F('flags').bitor(Project.flags.has_releases))
    except IntegrityError:
        return False
    else:
        return True
