Skip to content

Commit

Permalink
refactor: update Dataset.is_in_project function
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley committed Sep 27, 2024
1 parent 88af424 commit d78a494
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions uvdat/core/models/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d78a494

Please sign in to comment.