From 50995b0a0f2ed703bba36d82f5ad61053edf86be Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Sat, 25 Aug 2018 10:21:22 -0400 Subject: [PATCH] Remove Premium setting and restrictions --- events/admin.py | 4 +-- .../0043_remove_premium_restrictions.py | 29 +++++++++++++++++++ events/models/profiles.py | 5 ---- .../get_together/events/show_event.html | 3 +- get_together/views/events.py | 3 -- get_together/views/speakers.py | 6 ---- 6 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 events/migrations/0043_remove_premium_restrictions.py diff --git a/events/admin.py b/events/admin.py index f97ff2d..5aa820d 100644 --- a/events/admin.py +++ b/events/admin.py @@ -68,8 +68,8 @@ admin.site.register(Sponsor, SponsorAdmin) class TeamAdmin(admin.ModelAdmin): raw_id_fields = ('country', 'spr', 'city', 'owner_profile', 'admin_profiles', 'contact_profiles', 'sponsors') - list_display = ('__str__', 'active', 'member_count', 'event_count', 'owner_profile', 'created_date', 'access', 'is_premium') - list_filter = ('active', 'access', 'is_premium', 'organization', ('country',admin.RelatedOnlyFieldListFilter)) + list_display = ('__str__', 'active', 'member_count', 'event_count', 'owner_profile', 'created_date', 'access') + list_filter = ('active', 'access', 'organization', ('country',admin.RelatedOnlyFieldListFilter)) ordering = ('-created_date',) def member_count(self, team): diff --git a/events/migrations/0043_remove_premium_restrictions.py b/events/migrations/0043_remove_premium_restrictions.py new file mode 100644 index 0000000..5e28a9a --- /dev/null +++ b/events/migrations/0043_remove_premium_restrictions.py @@ -0,0 +1,29 @@ +# Generated by Django 2.0 on 2018-08-25 14:19 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('events', '0042_allow_team_without_country'), + ] + + operations = [ + migrations.RemoveField( + model_name='team', + name='is_premium', + ), + migrations.RemoveField( + model_name='team', + name='premium_by', + ), + migrations.RemoveField( + model_name='team', + name='premium_expires', + ), + migrations.RemoveField( + model_name='team', + name='premium_started', + ), + ] diff --git a/events/models/profiles.py b/events/models/profiles.py index 43546e7..51720c5 100644 --- a/events/models/profiles.py +++ b/events/models/profiles.py @@ -369,11 +369,6 @@ class Team(models.Model): sponsors = models.ManyToManyField('Sponsor', related_name='teams', blank=True) - is_premium = models.BooleanField(default=settings.EVENTS_TEAMS_DEFAULT_PREMIUM) - premium_by = models.ForeignKey(UserProfile, related_name='premium_teams', null=True, blank=True, on_delete=models.SET_NULL) - premium_started = models.DateTimeField(blank=True, null=True) - premium_expires = models.DateTimeField(blank=True, null=True) - objects = models.Manager() public_objects = PublicTeamsManager() diff --git a/get_together/templates/get_together/events/show_event.html b/get_together/templates/get_together/events/show_event.html index ac6775a..7eb3924 100644 --- a/get_together/templates/get_together/events/show_event.html +++ b/get_together/templates/get_together/events/show_event.html @@ -210,7 +210,6 @@ {% endif %} - {% if event.team.is_premium %}
Presentations:
@@ -225,7 +224,7 @@ {% endif %}
- {% endif %} +
diff --git a/get_together/views/events.py b/get_together/views/events.py index da7d9f8..6999985 100644 --- a/get_together/views/events.py +++ b/get_together/views/events.py @@ -174,9 +174,6 @@ def manage_event_sponsors(request, event_id): if not request.user.profile.can_edit_event(event): messages.add_message(request, messages.WARNING, message=_('You can not manage this event\'s sponsorss.')) return redirect(event.get_absolute_url()) - if not event.team.is_premium: - messages.add_message(request, messages.ERROR, message=mark_safe(_('Upgrade this team to a Premium account to use this feature.'))) - return redirect(event.get_absolute_url()) team_sponsors = list(event.team.sponsors.all()) events_sponsors = list(Sponsor.objects.filter(events__team=event.team)) diff --git a/get_together/views/speakers.py b/get_together/views/speakers.py index 9d69d01..2d31348 100644 --- a/get_together/views/speakers.py +++ b/get_together/views/speakers.py @@ -239,9 +239,6 @@ def delete_talk(request, talk_id): @login_required def propose_event_talk(request, event_id): event = get_object_or_404(Event, id=event_id) - if not event.team.is_premium: - messages.add_message(request, messages.ERROR, message=_("You can not manage talks for this event.")) - return redirect(event.get_absolute_url()) if request.method == 'GET': profile = request.user.profile @@ -311,9 +308,6 @@ def schedule_event_talks(request, event_id): if not request.user.profile.can_edit_event(event): messages.add_message(request, messages.ERROR, message=mark_safe(_('You can not manage talks for this event.'))) return redirect(event.get_absolute_url()) - if not event.team.is_premium: - messages.add_message(request, messages.ERROR, message=mark_safe(_('Upgrade this team to a Premium account to use this feature.'))) - return redirect(event.get_absolute_url()) if request.method == 'POST': presentation = get_object_or_404(Presentation, id=request.POST.get('presentation_id'))