From 2083194bcf2e88dcaa2257aeeebbbbded6b5e695 Mon Sep 17 00:00:00 2001 From: Andrew Williamson Date: Thu, 19 May 2016 16:57:49 +0100 Subject: [PATCH] HubPromo and HubEvent seems to unused so removing them. --- src/olympia/devhub/admin.py | 13 +----- src/olympia/devhub/models.py | 42 ------------------- .../877-drop-hubpromo-hubevent-tables.sql | 1 + 3 files changed, 2 insertions(+), 54 deletions(-) create mode 100644 src/olympia/migrations/877-drop-hubpromo-hubevent-tables.sql diff --git a/src/olympia/devhub/admin.py b/src/olympia/devhub/admin.py index 2bde7f8236..a7504b893b 100644 --- a/src/olympia/devhub/admin.py +++ b/src/olympia/devhub/admin.py @@ -1,15 +1,6 @@ from django.contrib import admin -from .models import HubPromo, HubEvent, ActivityLog - - -class HubPromoAdmin(admin.ModelAdmin): - list_display = ('heading', 'body', 'visibility') - list_editable = ('visibility',) - - -class HubEventAdmin(admin.ModelAdmin): - list_display = ('name', 'url', 'location', 'date') +from .models import ActivityLog class HubNewsAdmin(admin.ModelAdmin): @@ -26,6 +17,4 @@ class HubNewsAdmin(admin.ModelAdmin): def has_delete_permission(self, request, obj=None): return False -admin.site.register(HubPromo, HubPromoAdmin) -admin.site.register(HubEvent, HubEventAdmin) admin.site.register(ActivityLog, HubNewsAdmin) diff --git a/src/olympia/devhub/models.py b/src/olympia/devhub/models.py index 0ab85a05da..68bdfbcfcc 100644 --- a/src/olympia/devhub/models.py +++ b/src/olympia/devhub/models.py @@ -21,7 +21,6 @@ from olympia.bandwagon.models import Collection from olympia.files.models import File from olympia.reviews.models import Review from olympia.tags.models import Tag -from olympia.translations.fields import save_signal, TranslatedField from olympia.users.helpers import user_link from olympia.users.models import UserProfile from olympia.versions.models import Version @@ -48,47 +47,6 @@ class BlogPost(ModelBase): db_table = 'blogposts' -class HubPromo(ModelBase): - VISIBILITY_CHOICES = ( - (0, 'Nobody'), - (1, 'Visitors'), - (2, 'Developers'), - (3, 'Visitors and Developers'), - ) - - heading = TranslatedField() - body = TranslatedField() - visibility = models.SmallIntegerField(choices=VISIBILITY_CHOICES) - - class Meta: - db_table = 'hubpromos' - - def __unicode__(self): - return unicode(self.heading) - - def flush_urls(self): - return ['*/developers*'] - -models.signals.pre_save.connect(save_signal, sender=HubPromo, - dispatch_uid='hubpromo_translations') - - -class HubEvent(ModelBase): - name = models.CharField(max_length=255, default='') - url = models.URLField(max_length=255, default='') - location = models.CharField(max_length=255, default='') - date = models.DateField(default=datetime.now) - - class Meta: - db_table = 'hubevents' - - def __unicode__(self): - return self.name - - def flush_urls(self): - return ['*/developers*'] - - class AddonLog(ModelBase): """ This table is for indexing the activity log by addon. diff --git a/src/olympia/migrations/877-drop-hubpromo-hubevent-tables.sql b/src/olympia/migrations/877-drop-hubpromo-hubevent-tables.sql new file mode 100644 index 0000000000..6b9e57afa5 --- /dev/null +++ b/src/olympia/migrations/877-drop-hubpromo-hubevent-tables.sql @@ -0,0 +1 @@ +DROP TABLE hubpromos, hubevents;