Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove DiskQuota model #2599

Merged
merged 2 commits into from
Feb 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 6 additions & 13 deletions refinery/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
from django_extensions.admin import ForeignKeyAutocompleteAdmin
from guardian.admin import GuardedModelAdmin

from core.models import (Analysis, AnalysisNodeConnection, AnalysisResult,
DataSet, DiskQuota, Download, ExtendedGroup,
InvestigationLink, Invitation, Ontology, Project,
SiteProfile, Tutorials, UserProfile, Workflow,
WorkflowDataInput, WorkflowDataInputMap,
WorkflowEngine, WorkflowInputRelationships)
from core.utils import admin_ui_deletion
from .models import (Analysis, AnalysisNodeConnection, AnalysisResult, DataSet,
Download, ExtendedGroup, InvestigationLink, Invitation,
Ontology, Project, SiteProfile, Tutorials, UserProfile,
Workflow, WorkflowDataInput, WorkflowDataInputMap,
WorkflowEngine, WorkflowInputRelationships)
from .utils import admin_ui_deletion

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need the DiskQuotaAdmin class?


class AnalysisNodeConnectionAdmin(ForeignKeyAutocompleteAdmin):
Expand Down Expand Up @@ -118,11 +117,6 @@ def delete_model(self, request, obj):
actions = [delete_selected]


class DiskQuotaAdmin(GuardedModelAdmin):
list_display = ['__unicode__', 'id', 'name', 'summary', 'maximum',
'current']


class DownloadAdmin(GuardedModelAdmin, ForeignKeyAutocompleteAdmin):
list_display = ['__unicode__', 'id', 'data_set', 'analysis',
'file_store_item']
Expand Down Expand Up @@ -179,7 +173,6 @@ class SiteProfileAdmin(GuardedModelAdmin):
admin.site.register(Download, DownloadAdmin)
admin.site.register(AnalysisResult, AnalysisResultAdmin)
admin.site.register(AnalysisNodeConnection, AnalysisNodeConnectionAdmin)
admin.site.register(DiskQuota, DiskQuotaAdmin)
admin.site.register(Invitation, InvitationAdmin)
admin.site.register(UserProfile, UserProfileAdmin)
admin.site.register(Tutorials, TutorialsAdmin)
Expand Down
17 changes: 17 additions & 0 deletions refinery/core/migrations/0017_delete_diskquota.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

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

operations = [
migrations.DeleteModel(
name='DiskQuota',
),
]
20 changes: 0 additions & 20 deletions refinery/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,26 +903,6 @@ class Meta:
)


class DiskQuota(SharableResource, ManageableResource):
# quota is given in bytes
maximum = models.IntegerField()
current = models.IntegerField()

def __unicode__(self):
return (
self.name + " - Quota: " + str(
self.current / (1024 * 1024 * 1024)) +
" of " + str(self.maximum / (1024 * 1024 * 1024)) + "GB available"
)

class Meta:
verbose_name = "diskquota"
permissions = (
('read_%s' % verbose_name, 'Can read %s' % verbose_name),
('share_%s' % verbose_name, 'Can share %s' % verbose_name),
)


class WorkflowInputRelationships(models.Model):
"""Defines relationships between inputs based on the input string
assoicated with each workflow i.e refinery_relationship=[{"category":"1-1",
Expand Down