feat: Remove slug field from ResearchStudy model and update related references

This commit is contained in:
Ross
2026-05-12 21:51:44 +01:00
parent c94d2fb1a7
commit 89e89cef73
10 changed files with 68 additions and 35 deletions
+1 -5
View File
@@ -1,13 +1,10 @@
from django.db import models
from django.conf import settings
from django.urls import reverse
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from django.core.exceptions import ValidationError
from generic.mixins import AuthorMixin
from generic.models import CidUser
from atlas.models import CaseCollection
from loguru import logger
class ResearchStudy(models.Model, AuthorMixin):
@@ -24,7 +21,6 @@ class ResearchStudy(models.Model, AuthorMixin):
BULK_ONLY = "BULK", _("Bulk generation only")
name = models.CharField(max_length=255)
slug = models.SlugField(max_length=100, unique=True)
description = models.TextField(blank=True)
active = models.BooleanField(default=True)
@@ -222,7 +218,7 @@ class ResearchParticipant(models.Model):
verbose_name_plural = "Research Participants"
def __str__(self):
return f"{self.study.slug}:{self.pseudo_id}"
return f"{self.study.pk}:{self.pseudo_id}"
def is_prerequisite_satisfied(self):
"""Check if participant has completed prerequisite arm(s) for current assignment."""