Projet

Général

Profil

0001-add-unique-constraint-to-UserExternalId-32833.patch

Benjamin Dauvergne, 21 juin 2019 13:33

Télécharger (1,88 ko)

Voir les différences:

Subject: [PATCH 1/6] add unique constraint to UserExternalId (#32833)

 .../migrations/0024_auto_20190617_1113.py     | 29 +++++++++++++++++++
 src/authentic2/models.py                      |  3 ++
 2 files changed, 32 insertions(+)
 create mode 100644 src/authentic2/migrations/0024_auto_20190617_1113.py
src/authentic2/migrations/0024_auto_20190617_1113.py
1
# -*- coding: utf-8 -*-
2
# Generated by Django 1.11.20 on 2019-06-17 09:13
3
from __future__ import unicode_literals
4

  
5
from django.db import migrations
6

  
7

  
8
class Migration(migrations.Migration):
9

  
10
    dependencies = [
11
        ('custom_user', '0016_auto_20180925_1107'),
12
        ('authentic2', '0023_auto_20181031_0900'),
13
    ]
14

  
15
    operations = [
16
        migrations.CreateModel(
17
            name='LDAPUser',
18
            fields=[
19
            ],
20
            options={
21
                'proxy': True,
22
            },
23
            bases=('custom_user.user',),
24
        ),
25
        migrations.AlterUniqueTogether(
26
            name='userexternalid',
27
            unique_together=set([('source', 'external_id')]),
28
        ),
29
    ]
src/authentic2/models.py
75 75
    class Meta:
76 76
        verbose_name = _('user external id')
77 77
        verbose_name_plural = _('user external ids')
78
        unique_together = [
79
            ('source', 'external_id'),
80
        ]
78 81

  
79 82

  
80 83
@six.python_2_unicode_compatible
81
-