diff --git a/uvdat/core/models/dataset.py b/uvdat/core/models/dataset.py index 1fbb0eee..70aaecc6 100644 --- a/uvdat/core/models/dataset.py +++ b/uvdat/core/models/dataset.py @@ -17,10 +17,7 @@ class DatasetType(models.TextChoices): ) def is_in_project(self, project_id): - from uvdat.core.models import Project - - project = Project.objects.get(id=project_id) - return project.datasets.filter(id=self.id).exists() + return self.project_set.filter(id=project_id).exists() def readable_by(self, user): return True