Project

General

Profile

0001-a2_rbac-add-a-validate_emails-flag-to-OU-model-19716.patch

Benjamin Dauvergne, 04 December 2017 03:13 PM

Download (2.58 KB)

View differences:

Subject: [PATCH 1/3] a2_rbac: add a validate_emails flag to OU model (#19716)

 .../0015_organizationalunit_validate_emails.py        | 19 +++++++++++++++++++
 src/authentic2/a2_rbac/models.py                      |  5 +++++
 src/authentic2/manager/forms.py                       |  2 +-
 3 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 src/authentic2/a2_rbac/migrations/0015_organizationalunit_validate_emails.py
src/authentic2/a2_rbac/migrations/0015_organizationalunit_validate_emails.py
1
# -*- coding: utf-8 -*-
2
from __future__ import unicode_literals
3

  
4
from django.db import migrations, models
5

  
6

  
7
class Migration(migrations.Migration):
8

  
9
    dependencies = [
10
        ('a2_rbac', '0014_auto_20170711_1024'),
11
    ]
12

  
13
    operations = [
14
        migrations.AddField(
15
            model_name='organizationalunit',
16
            name='validate_emails',
17
            field=models.BooleanField(default=False, verbose_name='Validate emails'),
18
        ),
19
    ]
src/authentic2/a2_rbac/models.py
35 35
    default = fields.UniqueBooleanField(
36 36
        verbose_name=_('Default organizational unit'))
37 37

  
38
    validate_emails = models.BooleanField(
39
        blank=True,
40
        default=False,
41
        verbose_name=_('Validate emails'))
42

  
38 43
    admin_perms = GenericRelation(rbac_utils.get_permission_model_name(),
39 44
                                  content_type_field='target_ct',
40 45
                                  object_id_field='target_id')
src/authentic2/manager/forms.py
622 622

  
623 623
    class Meta:
624 624
        model = get_ou_model()
625
        fields = ('name', 'default', 'username_is_unique', 'email_is_unique')
625
        fields = ('name', 'default', 'username_is_unique', 'email_is_unique', 'validate_emails')
626 626

  
627 627

  
628 628
def get_role_form_class():
629
-