Remove Premium setting and restrictions
This commit is contained in:
parent
117f4e8dc2
commit
50995b0a0f
6 changed files with 32 additions and 18 deletions
|
@ -68,8 +68,8 @@ admin.site.register(Sponsor, SponsorAdmin)
|
||||||
|
|
||||||
class TeamAdmin(admin.ModelAdmin):
|
class TeamAdmin(admin.ModelAdmin):
|
||||||
raw_id_fields = ('country', 'spr', 'city', 'owner_profile', 'admin_profiles', 'contact_profiles', 'sponsors')
|
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_display = ('__str__', 'active', 'member_count', 'event_count', 'owner_profile', 'created_date', 'access')
|
||||||
list_filter = ('active', 'access', 'is_premium', 'organization', ('country',admin.RelatedOnlyFieldListFilter))
|
list_filter = ('active', 'access', 'organization', ('country',admin.RelatedOnlyFieldListFilter))
|
||||||
ordering = ('-created_date',)
|
ordering = ('-created_date',)
|
||||||
|
|
||||||
def member_count(self, team):
|
def member_count(self, team):
|
||||||
|
|
29
events/migrations/0043_remove_premium_restrictions.py
Normal file
29
events/migrations/0043_remove_premium_restrictions.py
Normal 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',
|
||||||
|
),
|
||||||
|
]
|
|
@ -369,11 +369,6 @@ class Team(models.Model):
|
||||||
|
|
||||||
sponsors = models.ManyToManyField('Sponsor', related_name='teams', blank=True)
|
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()
|
objects = models.Manager()
|
||||||
public_objects = PublicTeamsManager()
|
public_objects = PublicTeamsManager()
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,6 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if event.team.is_premium %}
|
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<div class="col-3" width="120px"><b>Presentations:</b></div>
|
<div class="col-3" width="120px"><b>Presentations:</b></div>
|
||||||
<div class="col-9">
|
<div class="col-9">
|
||||||
|
@ -225,7 +224,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container container-secondary mt-3">
|
<div class="container container-secondary mt-3">
|
||||||
|
|
|
@ -174,9 +174,6 @@ def manage_event_sponsors(request, event_id):
|
||||||
if not request.user.profile.can_edit_event(event):
|
if not request.user.profile.can_edit_event(event):
|
||||||
messages.add_message(request, messages.WARNING, message=_('You can not manage this event\'s sponsorss.'))
|
messages.add_message(request, messages.WARNING, message=_('You can not manage this event\'s sponsorss.'))
|
||||||
return redirect(event.get_absolute_url())
|
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())
|
team_sponsors = list(event.team.sponsors.all())
|
||||||
events_sponsors = list(Sponsor.objects.filter(events__team=event.team))
|
events_sponsors = list(Sponsor.objects.filter(events__team=event.team))
|
||||||
|
|
|
@ -239,9 +239,6 @@ def delete_talk(request, talk_id):
|
||||||
@login_required
|
@login_required
|
||||||
def propose_event_talk(request, event_id):
|
def propose_event_talk(request, event_id):
|
||||||
event = get_object_or_404(Event, id=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':
|
if request.method == 'GET':
|
||||||
profile = request.user.profile
|
profile = request.user.profile
|
||||||
|
@ -311,9 +308,6 @@ def schedule_event_talks(request, event_id):
|
||||||
if not request.user.profile.can_edit_event(event):
|
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.')))
|
messages.add_message(request, messages.ERROR, message=mark_safe(_('You can not manage talks for this event.')))
|
||||||
return redirect(event.get_absolute_url())
|
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':
|
if request.method == 'POST':
|
||||||
presentation = get_object_or_404(Presentation, id=request.POST.get('presentation_id'))
|
presentation = get_object_or_404(Presentation, id=request.POST.get('presentation_id'))
|
||||||
|
|
Loading…
Reference in a new issue