Skip to content

Commit

Permalink
Do not add subject's projects to session projects upon save
Browse files Browse the repository at this point in the history
  • Loading branch information
k1o0 committed Mar 22, 2024
1 parent d07e412 commit e6f189f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions alyx/actions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,7 @@ def save(self, *args, **kwargs):
# Default project is the subject's projects.
if not self.lab:
self.lab = self.subject.lab
obj = super(Session, self).save(*args, **kwargs)
if self.projects.count() == 0 and self.subject.projects.count() > 0:
from subjects.models import Project
self.projects.add(*Project.objects.filter(subject=self.subject))
return obj
return super(Session, self).save(*args, **kwargs)

def __str__(self):
try:
Expand Down

0 comments on commit e6f189f

Please sign in to comment.