Merge branch 'nabos' into 'master'

Changed default display time for posters and permissions on it

See merge request ae/Sith!142
This commit is contained in:
Antoine Bartuccio 2018-03-18 22:45:11 +01:00
commit 41c83b17df
3 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('com', '0004_auto_20171221_1614'),
]
operations = [
migrations.AlterField(
model_name='poster',
name='display_time',
field=models.IntegerField(verbose_name='display time', default=15),
),
]

View File

@ -212,7 +212,7 @@ class Poster(models.Model):
screens = models.ManyToManyField(Screen, related_name="posters")
date_begin = models.DateTimeField(blank=False, null=False, default=timezone.now)
date_end = models.DateTimeField(blank=True, null=True)
display_time = models.IntegerField(_("display time"), blank=False, null=False, default=30)
display_time = models.IntegerField(_("display time"), blank=False, null=False, default=15)
is_moderated = models.BooleanField(_("is moderated"), default=False)
moderator = models.ForeignKey(User, related_name="moderated_posters", verbose_name=_("moderator"), null=True, blank=True)

View File

@ -72,6 +72,7 @@ class PosterForm(forms.ModelForm):
if self.user:
if not self.user.is_com_admin:
self.fields['club'].queryset = Club.objects.filter(id__in=self.user.clubs_with_rights)
self.fields['display_time'].widget = forms.HiddenInput()
class ComTabsMixin(TabedViewMixin):