diff --git a/atlas/admin.py b/atlas/admin.py index a43e60e4..a35f5611 100755 --- a/atlas/admin.py +++ b/atlas/admin.py @@ -15,6 +15,8 @@ from .models import ( PathologicalProcess, Presentation, UncategorisedDicom, + SeriesDetail, + Resource ) from django.forms import ModelForm @@ -42,6 +44,8 @@ admin.site.register(PathologicalProcess) admin.site.register(Presentation) admin.site.register(CaseDetail) admin.site.register(UncategorisedDicom) +admin.site.register(SeriesDetail) +admin.site.register(Resource) class DifferentialInline(admin.TabularInline): diff --git a/atlas/api.py b/atlas/api.py index c2678305..a0d29556 100644 --- a/atlas/api.py +++ b/atlas/api.py @@ -23,6 +23,8 @@ from generic.models import Examination, Modality from .models import Case, DuplicateDicom, Series, SeriesImage, UncategorisedDicom +from loguru import logger + router = Router() @@ -52,6 +54,7 @@ class CaseSchema(ModelSchema): model_fields = ["id", "title"] +@logger.catch() @router.post("/upload_dicom", auth=django_auth) def upload_dicom(request, files: List[UploadedFile] = File(...)): uploaded = [] diff --git a/atlas/forms.py b/atlas/forms.py index 021695ef..7500f73a 100755 --- a/atlas/forms.py +++ b/atlas/forms.py @@ -695,4 +695,7 @@ class CaseCollectionAuthorForm(ExamAuthorFormMixin): class CaseAuthorForm(ExamAuthorFormMixin): class Meta(ExamAuthorFormMixin.Meta): - model = Case \ No newline at end of file + model = Case +class SeriesAuthorForm(ExamAuthorFormMixin): + class Meta(ExamAuthorFormMixin.Meta): + model = Series \ No newline at end of file diff --git a/atlas/models.py b/atlas/models.py index 9cb3a26b..21abc328 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -69,6 +69,8 @@ from django.contrib.contenttypes.fields import GenericRelation from django.core.validators import MaxValueValidator, MinValueValidator +from loguru import logger + image_storage = FileSystemStorage( # Physical file location ROOT @@ -685,6 +687,13 @@ class Series(SeriesBase): self.save() + def get_base_template(self): + return "atlas/base.html" + + def get_link_headers(self): + return "atlas/series_headers.html" + + class CaseCollection(ExamOrCollectionGenericBase): app_name = "atlas" @@ -1099,6 +1108,7 @@ class UncategorisedDicom(models.Model): return duplicate + @logger.catch() def save(self, *args, **kwargs): """Override save method to add image hash""" if self.image: diff --git a/atlas/templates/atlas/case_form.html b/atlas/templates/atlas/case_form.html index a1fbeb0a..2d7cd002 100755 --- a/atlas/templates/atlas/case_form.html +++ b/atlas/templates/atlas/case_form.html @@ -71,7 +71,7 @@