Skip to content

Commit

Permalink
last call column on invite view should reflect only the current exper…
Browse files Browse the repository at this point in the history
…iment (closes #230)
  • Loading branch information
bbonf committed Oct 8, 2024
1 parent f36e5e2 commit c033284
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions lab/experiments/views/invite_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def get_object_list(self):
participant.invitation_set.filter(experiment=self.experiment).order_by("-creation_date").first()
)
participant.invite = invite

participant.last_call = (
participant.call_set.filter(experiment=self.experiment).order_by("-creation_date").first()
)
except ObjectDoesNotExist:
participant.invite = None

Expand Down
4 changes: 0 additions & 4 deletions lab/participants/models/participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,6 @@ def age_long(self):
def gestational_age(self):
return self.PregnancyDuration[self.pregnancy_duration].label

@property
def last_call(self):
return self.call_set.order_by("-creation_date").first()

def deactivate(self):
with transaction.atomic():
for appointment in self.appointments.all():
Expand Down

0 comments on commit c033284

Please sign in to comment.