From e6f189fb82b55d049a7bf4888aa6fd9b1272a1db Mon Sep 17 00:00:00 2001 From: k1o0 Date: Thu, 21 Mar 2024 18:10:40 +0200 Subject: [PATCH] Do not add subject's projects to session projects upon save --- alyx/actions/models.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/alyx/actions/models.py b/alyx/actions/models.py index 44d47c14..c6b6adb9 100644 --- a/alyx/actions/models.py +++ b/alyx/actions/models.py @@ -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: