Skip to content

Commit

Permalink
Merge pull request #216 from OpenImaging/remove-site
Browse files Browse the repository at this point in the history
Remove site model
  • Loading branch information
annehaley authored Nov 5, 2021
2 parents 8f9e818 + a345968 commit 50eacf0
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 67 deletions.
15 changes: 1 addition & 14 deletions miqa/core/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from django.contrib import admin

from .models import Evaluation, Experiment, Image, Project, Scan, ScanDecision, Site
from .models import Evaluation, Experiment, Image, Project, Scan, ScanDecision


@admin.register(Experiment)
Expand Down Expand Up @@ -51,16 +51,3 @@ class ProjectAdmin(admin.ModelAdmin):
)
list_filter = ('created', 'modified', 'creator')
search_fields = ('name',)


@admin.register(Site)
class SiteAdmin(admin.ModelAdmin):
list_display = (
'id',
'created',
'modified',
'name',
'creator',
)
list_filter = ('created', 'modified', 'creator')
search_fields = ('name',)
16 changes: 16 additions & 0 deletions miqa/core/migrations/0017_remove_site.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 3.2.8 on 2021-10-29 19:17

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('core', '0016_scan_decision'),
]

operations = [
migrations.DeleteModel(
name='Site',
),
]
2 changes: 0 additions & 2 deletions miqa/core/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
from .project import Project
from .scan import Scan
from .scan_decision import ScanDecision
from .site import Site

__all__ = [
'Experiment',
'Image',
'Scan',
'Evaluation',
'Project',
'Site',
'ScanDecision',
]
14 changes: 0 additions & 14 deletions miqa/core/models/site.py

This file was deleted.

2 changes: 0 additions & 2 deletions miqa/core/rest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from .project import ProjectViewSet
from .scan import ScanViewSet
from .scan_decision import ScanDecisionViewSet
from .site import SiteViewSet
from .user import UserViewSet

__all__ = [
Expand All @@ -16,7 +15,6 @@
'LogoutView',
'ProjectViewSet',
'ScanViewSet',
'SiteViewSet',
'UserViewSet',
'ScanDecisionViewSet',
'EmailView',
Expand Down
20 changes: 0 additions & 20 deletions miqa/core/rest/site.py

This file was deleted.

2 changes: 0 additions & 2 deletions miqa/core/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
ProjectFactory,
ScanDecisionFactory,
ScanFactory,
SiteFactory,
UserFactory,
)

Expand Down Expand Up @@ -53,7 +52,6 @@ def generator():

register(ScanDecisionFactory)
register(UserFactory)
register(SiteFactory)
register(ProjectFactory)
register(ExperimentFactory)
register(ScanFactory)
Expand Down
12 changes: 1 addition & 11 deletions miqa/core/tests/factories.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.contrib.auth.models import User
import factory

from miqa.core.models import Experiment, Image, Project, Scan, ScanDecision, Site
from miqa.core.models import Experiment, Image, Project, Scan, ScanDecision


class UserFactory(factory.django.DjangoModelFactory):
Expand All @@ -14,16 +14,6 @@ class Meta:
last_name = factory.Faker('last_name')


class SiteFactory(factory.django.DjangoModelFactory):
class Meta:
model = Site

id = factory.Faker('uuid4')
name = factory.Faker('word')

creator = factory.SubFactory(UserFactory)


class ProjectFactory(factory.django.DjangoModelFactory):
class Meta:
model = Project
Expand Down
2 changes: 0 additions & 2 deletions miqa/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
ProjectViewSet,
ScanDecisionViewSet,
ScanViewSet,
SiteViewSet,
UserViewSet,
)

Expand All @@ -23,7 +22,6 @@
router.register('experiments', ExperimentViewSet)
router.register('scans', ScanViewSet)
router.register('images', ImageViewSet)
router.register('sites', SiteViewSet)
router.register('users', UserViewSet)
router.register('scan-decisions', ScanDecisionViewSet)

Expand Down

0 comments on commit 50eacf0

Please sign in to comment.