mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-08-19 21:53:41 +00:00
Club : Add option to specify if a mailing should be generated for
This commit is contained in:
parent
082f684781
commit
377447d23b
4 changed files with 34 additions and 0 deletions
|
@ -343,6 +343,7 @@ class ClubForm(FieldPermissionFormMixin, ModelForm):
|
|||
self.fields['room'].label = 'Local'
|
||||
self.fields['room'].empty_label = "Pas de chambre"
|
||||
self.fields['school'].empty_label = "Séléctionner un établissement"
|
||||
self.fields['mailing'].label = 'Utiliser une mailing'
|
||||
|
||||
class Meta:
|
||||
model = Club
|
||||
|
@ -355,6 +356,7 @@ class ClubForm(FieldPermissionFormMixin, ModelForm):
|
|||
'room',
|
||||
'telephone',
|
||||
'shell',
|
||||
'mailing'
|
||||
]
|
||||
|
||||
def clean_telephone(self):
|
||||
|
|
20
users/migrations/0069_club_mailing.py
Normal file
20
users/migrations/0069_club_mailing.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.7 on 2018-03-07 15:34
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('users', '0068_auto_20180107_2245'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='club',
|
||||
name='mailing',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
|
@ -850,6 +850,9 @@ class Club(User):
|
|||
to='users.Adherent',
|
||||
related_name='club_members'
|
||||
)
|
||||
mailing = models.BooleanField(
|
||||
default = False
|
||||
)
|
||||
|
||||
def can_create(user_request, *args, **kwargs):
|
||||
"""Check if an user can create an user object.
|
||||
|
|
|
@ -60,8 +60,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
</p>
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
{% if users.is_class_club %}
|
||||
<th>Mailing</th>
|
||||
{% if users.club.mailing %}
|
||||
<td>{{ users.pseudo }}(-admin)</td>
|
||||
{% else %}
|
||||
<td>Mailing désactivée</td>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<th>Prénom</th>
|
||||
<td>{{ users.name }}</td>
|
||||
{% endif %}
|
||||
<th>Nom</th>
|
||||
<td>{{ users.surname }}</td>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in a new issue