Skip to content

Commit

Permalink
fix: enforce an owner on server-created projects
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley committed Oct 1, 2024
1 parent e157327 commit de9725c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions sample_data/ingest_use_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def ingest_projects(use_case):
print('\t', f'Project {project_for_setting.name} created.')

project_for_setting.datasets.set(Dataset.objects.filter(name__in=project['datasets']))
project_for_setting.set_permissions(owner=User.objects.filter(is_superuser=True).first())


def ingest_charts(use_case):
Expand Down
5 changes: 4 additions & 1 deletion uvdat/core/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@

@pytest.fixture
def test_project() -> Project:
return Project.objects.create(
project = Project.objects.create(
name='Test Project', default_map_zoom=10, default_map_center=Point(42, -71)
)
original_owner = User.objects.create(username='testowner')
project.set_permissions(owner=original_owner)
return project


@pytest.fixture
Expand Down

0 comments on commit de9725c

Please sign in to comment.