Remove Premium setting and restrictions

This commit is contained in:
Michael Hall 2018-08-25 10:21:22 -04:00
parent 117f4e8dc2
commit 50995b0a0f
6 changed files with 32 additions and 18 deletions

View file

@ -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):

View file

@ -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',
),
]

View file

@ -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()

View file

@ -210,7 +210,6 @@
</div>
{% endif %}
{% if event.team.is_premium %}
<div class="row mb-2">
<div class="col-3" width="120px"><b>Presentations:</b></div>
<div class="col-9">
@ -225,7 +224,7 @@
{% endif %}
</div>
</div>
{% endif %}
</div>
<div class="container container-secondary mt-3">

View file

@ -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 <a href="/about/premium">Premium</a> 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))

View file

@ -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 <a href="/about/premium">Premium</a> 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'))