Refactor NormalCase model: remove 'added_by' field, add 'author' ManyToManyField; update related views and templates for editing functionality

This commit is contained in:
Ross
2026-02-16 13:32:06 +00:00
parent 64103cac1e
commit 0b6661c018
9 changed files with 134 additions and 25 deletions
+8 -9
View File
@@ -766,7 +766,7 @@ class Case(models.Model, AuthorMixin, QuestionMixin):
return json.dumps(results)
class NormalCase(models.Model):
class NormalCase(models.Model, AuthorMixin):
"""Marks a Case as a 'normal' example used in the Atlas normals section.
This version stores a canonical `age_days` integer (patient age in days).
@@ -819,16 +819,15 @@ class NormalCase(models.Model):
help_text="Primary modality for this normal case (optional).",
)
added_by = models.ForeignKey(
settings.AUTH_USER_MODEL,
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name="added_normals",
)
added_date = models.DateTimeField(default=timezone.now)
author = models.ManyToManyField(
settings.AUTH_USER_MODEL,
blank=True,
related_name="normal_cases",
)
notes = models.TextField(null=True, blank=True)
class Meta: