Projet

Général

Profil

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

Benjamin Dauvergne, 17 juin 2019 12:27

Télécharger (1,91 ko)

Voir les différences:

Subject: [PATCH 1/4] add unique constraint to UserExternalId

 .../migrations/0024_auto_20190617_1113.py     | 30 +++++++++++++++++++
 src/authentic2/models.py                      |  3 ++
 2 files changed, 33 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
                'indexes': [],
23
            },
24
            bases=('custom_user.user',),
25
        ),
26
        migrations.AlterUniqueTogether(
27
            name='userexternalid',
28
            unique_together=set([('source', 'external_id')]),
29
        ),
30
    ]
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
-