Skip to content

Commit

Permalink
Remove DiskQuota model (#2599)
Browse files Browse the repository at this point in the history
* Remove DiskQuota model

* Remove DiskQuotaAdmin class
  • Loading branch information
hackdna committed Feb 16, 2018
1 parent 8f01113 commit 37d6b48
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 33 deletions.
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


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

0 comments on commit 37d6b48

Please sign in to comment.